• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

GC

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following are true about an unreachable object?
A. It will be garbage collected.
B. Its finalize() method will be invoked.
C. It can become reachable again.
D. It has a null value.
I feel the answers are A,B,C
Anybody would please confirm about is these answers are RIght???
I am sure that Answer is not D cuz ,Since we are Talking about Object We cannot say it has a Null Value.
thanks
sharana
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I think only c is correct.
A. It will be garbage collected.
A Object might or it might not be GC
B. Its finalize() method will be invoked.
A object is GC in two steps, first its finalize method is invoked and in the next GC turn it is garbage collected. but if the GC does not run at all, then its finalize method is not called, so its false

C. It can become reachable again.
This is true
D. It has a null value.
This is false
Thanks
Sanjeet
 
reply
    Bookmark Topic Watch Topic
  • New Topic