aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes finalize doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "finalize doubt" Watch "finalize doubt" New topic
Author

finalize doubt

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707


Given answers are a,c,d,e

I suspect the behavior of finalize...
How the things are happening here?



Please help!!!


Regards,
cmbhatt


cmbhatt
swarna dasa
Ranch Hand

Joined: Mar 15, 2007
Posts: 108
We really dont know if the GC does run, so Ans a) gets there.

As is evident, the answer is not predictable after A1A2A3A1.
The garbage collector could pick up the objects from the heap in any order.
So there is no right answer, but acde are possible answers.

Since GC is a daemon thread, it has a very small window when it can run, as the main method exits right after that statement.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: finalize doubt
 
Similar Threads
GC
Garbage collection...
GC Doubts
Garbage Collection
Garbage collection query