File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "disable override" Watch "disable override" New topic

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

Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
If a method is declared final, it can't be overridden.
I agree. Here's the link:
subject: disable override
jQuery in Action, 3rd edition