Hello Bert,
Thanks for taking time out to answer my querry,byt i still have a doubt .Let ME TELL YOU HOW I UNDERSTAND THE QUESTION
In the first three lines inside the main method three objects are created and the three reference variables i1,i2,i3 refer to them respectively
now after the i2.i=i3; line executes the object peviously referred to only by i3 now has 2 references i and i3.
after the i3.i=i4 executes the object referenced by i4 has 2 references i,i4 but the i3 object is referred only by i3 now.
similarly after the i4.i=i2 executes now i2 object is referred to by i and i2 but the other two objects have just single references.
so at this point there are three objects one being refered to by the i & i2,another refered by i3 and another by i4.
now after the following code runs
i2=null;
i3=null;
i4=null;
there still remains the i reference variable which referes to the object originally refered by i2.
so 2 objects are eligible for gc not three objects.
Please let me know where i am going wrong.
Let me take this oppurtunity to thank you and Kathy Sierra for writing a wonderful book.You have really made learning java enjoyable.