wood burning stoves 2.0*
The moose likes Java in General and the fly likes disable override Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "disable override" Watch "disable override" New topic
Author

disable override

Anthony Karta
Ranch Hand

Joined: Aug 09, 2004
Posts: 342
the scenario is

I have a classA with some public methods (used by other composite classes), but I don't want those methods get overide in classB when classB extends classA.

is that possible? maybe I need to re-design, if so, how?

many thanks
tony


SCJP 5
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
If a method is declared final, it can't be overridden.
 
 
subject: disable override