I am coming to Java from C++ and am having trouble grasping the true distinction between an object and a reference to the object.
When an object is instantiated a region of memory is reserved and to access/operate upon the data in the memory we use the reference to the object. This i understand but in my textbook the author states,
"An object reference variable that appears to hold an object actually contains a reference to that object. Strictly speaking, an object reference variable and an object are different, but most of the time the distinction can be ignored."
So I am curious as to when this distinction cannot be ignored. It kind of sounds like the way Pointers are distinguished from the address they point to. Do all Java reference variables operate in a similar fashion as C/C++ pointer variables? I.E are reference variables simply a pointer or reference to a memory address?
I have already gone through What are classes, references and objects? and I am still unclear as to how the distinction actually matters when working in Java. If anyone could provide an explanation or a link to a thorough explanation It would be greatly appreciated.