• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mock question for Garbage Collection  RSS feed

 
Sam Sunamin
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Whizlabs,



My answer for it is C since s refer to other object(Hello World) not the object created on line 1, so the object is eligible to collection.

Am I right? Please help me to confirm.

Thank you.
 
megha joshi
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right . C is the correct answer.

One more thing...K&B book states garbage collection with strings is not included in exam.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!