Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finalize

 
MS Khan Khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why finalize() method is made protected in Object class.plz give a solid logical answer.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic