I don't understand what is Node node; in this code. Is this an instance variable of type Node?
But why should have an object an instance variable of the same type as the object itself?

Code: Select all
class Node{
int id;
Node node;
public static void main(String[] args) {
Node n = new Node();
System.out.println(n.id);
System.out.println(n.node.id);
}
}