Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many objects are eligible for GC?

 
Kamil Wojcik
Ranch Hand
Posts: 78
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

SOURCE: SCJP K. Sierra & B. Bates (Self Test: chapter: 3 question: 1)



When // do Stuff is reached, how many objects are eligible for GC?

Answer is 2 - Only one CardBoard object (c1) and associated Short wrapper object.

My question is why object c3 is not eligible?
 
Palash Kumar
Ranch Hand
Posts: 33
MyEclipse IDE Oracle Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think there is no object to which c3 is referring...
c3 is just a "reference variable" having value NULL
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because c3 is... not an object It's only a null reference
 
Kamil Wojcik
Ranch Hand
Posts: 78
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You for replay, You are right! I've missed that c3 is not an Object
 
Abhijeet Pathak
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Kamil for asking my query.
Thank you Lucas for solving it for us.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic