This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes finalze method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "finalze method" Watch "finalze method" New topic
Author

finalze method

Smitha Ballikar
Ranch Hand

Joined: Aug 02, 2005
Posts: 99


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

Joined: Aug 23, 2005
Posts: 155
hi
the finalize() method is right... since we can make "protected" methods in super class to "public" in subclasses..
Ryan Kade
Ranch Hand

Joined: Aug 16, 2005
Posts: 69
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

Joined: Aug 03, 2002
Posts: 7729
Smitha, are you compiling and running your examples? Or are you studying Java theoretically?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
GeeCON Prague 2014
 
subject: finalze method