Java Reference
In-Depth Information
Method Overriding
In a class hierarchy, when a method in a subclass has the same return type and signature as
a method in its superclass, then the method in the subclass is said to override the method
in the superclass. When an overridden method is called from within a subclass, it will al-
ways refer to the version of that method defined by the subclass. The version of the method
defined by the superclass will be hidden. Consider the following:
Search WWH ::




Custom Search