• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collection

 
majohnad majohnad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic