Thankyou for the confirmation... I just want to know the difference between overridden methods and hidden methods as in one book..Khalid Mughal ,they say that static methods can be hidden...
Thanks in advance..
Some terminologies that you may be interested in, with their simple definitions:
Overloading - defining a method of the same name but with different signatures.
Overriding - ability to replace the superclass method with the subclass own method
Hiding - preventing a member from being inherited due to a declaration in the subclass.
Shadowing - when a method or variable cannot be refered to using a simple name because of an existence of a method or variable of the same name in the current scope. [ February 27, 2005: Message edited by: Alton Hernandez ]
The important difference between overriding instance methods and hiding static methods is: -for overridden methods, the choice of which method to call is made at execution time based on the actual type of the object referred to by the reference on which the method was called -for hidden methods, the choice of which method to call is made at compile time based only on the type of the reference on which the method is called
The rules on no narrowing access modifiers, no new throws clauses, same return types, matching static vs. nonstatic, all apply to both method overriding and method hiding.