It's not a secret anymore!
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
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
author & internet detective

Joined: May 26, 2003
Posts: 33130

I agree with you.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Finalize Drag and Drop - thoughts?
It's not a secret anymore!