posted 19 years ago
This was my interpretation of the code.
When y was created "i" gets the value 20, no problem
Then when z is created it passes the copy of the memory reference stored in y to the constructor, "a" is pointing to the same object as y.
then this() calls the no arg constructor which makes the value of i to 20 and then value of i is again changed to 30 (code i = 30).
All this time a,y and z are pointing to the same memory location.
so when GetVar() method is called it will display 30.
Can u tell me where did i go wrong ??
Thank you
[ December 22, 2004: Message edited by: Jugal Hans ]