my dog learned polymorphism
The moose likes Beginning Java and the fly likes finalize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "finalize" Watch "finalize" New topic


MS Khan Khan

Joined: Sep 23, 2003
Posts: 3
why finalize() method is made protected in Object class.plz give a solid logical answer.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
finalize can only be called by the object itself and not from outside.
It must be protected that subclasses are able to call the finalize method which the inherited from Object if none is implemented.
I agree. Here's the link:
subject: finalize
It's not a secret anymore!