aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
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://aspose.com/file-tools
 
subject: Garbage Collection
 
Similar Threads
finalize
why finalize() can't be defined as private?
Finalization Method
Gc question
difference between finally and finalize()