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 Android Security Essentials Live Lessons this week in the Android 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.
 
Don't get me started about those stupid light bulbs.
 
subject: disable override
 
Similar Threads
Scope and classes/methods
Object is null
The java.lang.Object class
Inheritance
Initialization