Hi,
I have questions re objects, primitives and collection accessing and references
I made a simple class
the second class uses the first class. running the second class outputs the following...
INSIDE SETTER : same object
INSIDE SETTER : equal values
SampleClassUser MAIN : equal values
INSIDE SETTER : same object
INSIDE SETTER : equal values
INSIDE CONSTRUCTOR : same object
INSIDE CONSTRUCTOR : equal values
INSIDE SETTER : same object
INSIDE SETTER : equal values
sc1 and sc2 : equal values
...i'm just curios why the last 3 lines are the way they are.
INSIDE SETTER : same object
INSIDE SETTER : equal values
sc1 and sc2 : equal values
how come while inside the setter method, the objects are the same object, and after leaving the setter method are not the same objects?
Can anyone point a good book that shows in detail how objects, primitives and collections are referenced, especially when passed to methods. Online reference is preferred since the availability of books can be a problem for me.
Thanks very much
