wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes a question about GC? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "a question about GC?" Watch "a question about GC?" New topic

a question about GC?

Peter Wei Cai

Joined: Oct 23, 2000
Posts: 2

Which of following are correct?
a, You can directly run the garbage collector whenever you want to
b, You can directly run the garbage collector whenever you want to, but you can not directly free the memory allocated by an object.
c, The garbage collector informs your object when it is about to be garbage collected.
Thank you for any suggestion!
Bin Zhao
Ranch Hand

Joined: Oct 04, 2000
Posts: 73
I think c) is the answer.
Since you can never directly run GC, a) and b) are wrong
Sagar Sharma
Ranch Hand

Joined: Aug 31, 2000
Posts: 92
c is obviously right because of the mark and sweep algorithm that the gc uses.
I agree. Here's the link: http://aspose.com/file-tools
subject: a question about GC?