This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Finalize Drag and Drop - thoughts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Finalize Drag and Drop - thoughts?" Watch "Finalize Drag and Drop - thoughts?" New topic

Finalize Drag and Drop - thoughts?

Jeff Levine

Joined: Jun 03, 2013
Posts: 8
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?

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30138

I agree with you.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
subject: Finalize Drag and Drop - thoughts?
Similar Threads
GC question on MindQ no. 37
Calling Bert Bates
finalize() question
Garbage Collection
MindQ (Q.37) GC