This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
the object to which reference variable javas is referring wont be garbage collected because even thought javas is assigned to null, bugs and bugs_INP is referring to it. also at #1 there is this reference to new StartBugs(). so i think zero objects will be garbage collected.
guys correct me if i'm wrong. I myself is little shaky on GC questions so would like to see more posts on this topic. have a great day.
Joined: Nov 23, 2011
Hi Gurpreet, The answer is 1 [explanation : "javas is the only object that cannot be reached by the JVM. The this reference will still be available at #1 "]
can you explain little more I don't understand what is happening to this reference?
can someone draw the diagram for it?