Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about Object class  RSS feed

 
Petromir Djunev
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made this instance of Object class in main method

Why couldn't I access finalize() method of sampleObject

 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Petromir Djunev wrote:Why couldn't I access finalize() method of sampleObject


It's declare with the protected access modifier. That method can be only accessed from classes within the same package, or from the subclass via the super() method call.

Henry
 
Petromir Djunev
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!