In Java programs, is it right to set an object equal to another one? To be more specific, I'm studying binary trees and I noticed in the following code:
public Node find(int key)
{
    Node current = root;
    while(current.iData != key) 
    {
        if(key < current.iData)
        {
            current = current.leftChild;
        } else {
            //...
        }
    }
}
that both Node current = root; and  current - current.leftChild; are setting an object equal to another one. Is this right?
 
     
     
    