Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finalze method

 
Smitha Ballikar
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


In one of the mock exams it sayd the finalize method signature is right.I thought it is protected.Also, if its wrong does a produce a runtime error or compile time.

Cheers
Smitha
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
the finalize() method is right... since we can make "protected" methods in super class to "public" in subclasses..
 
Ryan Kade
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember, overridding methods can always be less restrictive than their parent methods. The one exception are private methods, which of course can't be overridden because they can't be seen by the subclass.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smitha, are you compiling and running your examples? Or are you studying Java theoretically?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic