p = p.getNext();
The variable p can point to any Node.
The statement...
p = p.getNext();
...does this:
Step 1: evaluate the right hand side
p.getNext() evaluates to the pointer contained in the first Node
Step 2: p =
that pointer is copied into p
now p points to the second node.
The picture shows this.
This operation, moving a pointer from one Node to the next in a chain of Nodes
is a common operation in data structures.
It is called advancing the pointer.
Now p is pointing at the second Node (the one holding 493).
What would the following statement do?
p = p.getNext();