Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finalize Drag and Drop - thoughts?

 
Jeff Levine
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

Thoughts on the following OCPJP 5 mock exam question (Whizlabs practice test)?

The finalize method...
a) May or may not be called just before garbage collection happens.
b) Can be used to resurrect an object.

The correct answer is B, which I understand.
I chose option A, because the finalize method is only called once - if the object is resurrected, it will not be called before GC is called a second time.

Do both answers seem correct? If not, why isn't A correct?

Thanks,
Jeff
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic