jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Overriding and redefining Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Overriding and redefining " Watch "Overriding and redefining " New topic

Overriding and redefining

Dheepan Thangavelu

Joined: Oct 13, 2005
Posts: 4
Hi All
What is the Diff between Overriding and redefining a method.

Ishan Bhatt

Joined: Oct 09, 2005
Posts: 14
No difference.
Overriding is redefining a method previously implemented in a parent class to change its behavior.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I don't think "redefine" has a specific meaning in OO circles. If you mean override it will be clearer to say override.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Or were you thinking of static methods? Static methods can't be overridden, but
they can be hidden:

Here, f is an example of overriding, g is an example of hiding,
and h and k are syntax errors. Quiz: what output does this produce?

There is no emoticon for what I am feeling!
I agree. Here's the link: http://aspose.com/file-tools
subject: Overriding and redefining
It's not a secret anymore!