I'm coming from a background in C and C++, where I grew pretty comfortable with pointers and references. Now I'm learning Data Structures and Algorithms in Java, and I saw a slide talking about nodes in Linked Lists being structured as so
class Node<E>{
E element;
Node<E> next;
public Node(E o){
element = o;
}
}
Given my background, to me this looks like the next node is contained directly within this node, and there's nothing to clarify that it's a reference (pointer?) to a separate address in memory. I also know at this point that Java doesn't have pass-by-reference at all, which makes this even weirder (from my perspective). So I want to know, how do I tell the difference between variables that hold actual values or objects, and variables that hold references to other values/objects