*
The moose likes Java in General and the fly likes Need Clarification for Overriding concept. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need Clarification for Overriding concept." Watch "Need Clarification for Overriding concept." New topic
Author

Need Clarification for Overriding concept.

dinesh Venkatesan
Ranch Hand

Joined: Oct 12, 2006
Posts: 134
Hi All,

Please look at the following statements. I have taken this from Java Language Specification.

A class C inherits from its direct superclass and direct superinterfaces all non-private methods (whether abstract or not) of the superclass and superinterfaces that are public, protected or declared with default access in the same package as C and [BOLD]are neither overridden nor hidden by a declaration in the class.[/BOLD]

I am not able to get the concept clearly for the text mentioned bold.
Can anybody help me?

Thanks in Advance!!!
dinesh.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

So what is exactly your question - do you want to know what "overriding" means?

Overriding means that you write a method in a subclass that has the same signature (same name and same parameter types) as a method in its superclass. For example:

If class Sub did not have an implementation of someMethod(String), it would inherit the method from class Super.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Clarification for Overriding concept.