Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Clarification for Overriding concept.

 
dinesh Venkatesan
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic