aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Garbage Collection" Watch "Garbage Collection" New topic
Author

Garbage Collection

majohnad majohnad
Greenhorn

Joined: Jan 01, 2003
Posts: 24
Hi All,
is the below statement is right? if so how it is?
Any class that includes a finalize method should invoke its superclass' finalize method
Thanks inadvance
john


zxjohn
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

unlike constructors... finalize() methods are not implicitly chained. The thought behind "Any class that includes a finalize method should invoke its superclass' finalize method." Is to ensure that any actions done in the superclass's constructor should be undone by the superclass's finalize() method.
The superclass's constructor is imlicitly called, the superclass's finalize() method is not, so you should manually call it anytime you override the finalize() method.
Make sense? Did I explian that correctly? (It's a lil early, and my shower is still tryin to wake me up... dang day light savings thing...)


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Garbage Collection
 
Similar Threads
Gc question
why finalize() can't be defined as private?
difference between finally and finalize()
Finalization Method
finalize