I am learning about Single Linked List. On line 5 of the example I provide below, is an example of a self referential class being called. I feel an infinite amount is being allocated to next as when the Java compiler evaluates the size of Node, it recursively goes over line 5, to determine how much memory to allocate for Node. What am I misunderstanding about line 5.
Would you be able to explain self referential classes?
How much memory is being allocated to the next variable?
Why is line 5 valid? I thought infinite recursive loops would be invalid.
