[Oracle interview]What is Overriding?
When aclass defines a method using the same name, return type, and arguments as amethod in its superclass, the method in the class overrides the method in thesuperclass.When the method is invoked for an object of the class, it is thenew definition of the method that is called, and not the method definitionfrom superclass. Methods may be overridden to be more public, not moreprivate.
页:
[1]