Maha,
Here's what R&H says about
Overloading and Overrinding, p.169 and p.170:
"Using the same method name with identical arguments
and return type is known as OVERRIDING".
Afterwhile on page 170:
"In a strict subclass of the class that defines the original method,
the method name can be reused with identical argument types and order
and with identical return type. This is OVERRIDING."
This is clear enough for me.
Sun JDK's compiler confirms this wording to be correct too: try in my example of overriding static method to make it more protected than it is in the Base class.
Or as an alternative, add to it "throws Exception" that does not exist in the Base class method. The compiler now complains that it cannot "override" anymore, due to the rules of overriding not beeing respected.
Also recent posts here or by Marcus site were concluding on the
fact that "only static methods can override static methods".
The fact that "hiding" better describes what really
happens under the hood when we syntaxically override,
that is, mask a static method in a source code by
another definition for the same method signature
is undeniable, but less largely known.
We most often see overloaded/overriden methods in Mocks
exams and books. Hidden methods is not this common..
I'll use it from now.
JRoch
PS: I've replaced "Good Bye JRoch" with "Good Sunday JRoch"
in your example with oObject instanciations
[This message has been edited by JRoch (edited April 09, 2000).]