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?