This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

finalize() method - protected  RSS feed

 
Sreedevi Vinod
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finalize() method is declared protected in the Object class, then only classes in the same package or subclasses can call it. Then how will the garbage collector code access this method ?

Thanks
Devi
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All objects extend the Object class, by default!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!