In a class hierarchy, when a method in a subclass has the same name and type 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 always refer to the version of that method defined by the subclass. The version in the superclass will be hidden. If you wish to access the superclass’ version of an overridden method, you can do so by using ‘super’.
In order for any particular method to override another correctly :
The method must not throw checked exceptions of classes that are not possible for the original method.
Dinesh Thakur is a Columinist and designer with strong passion and founder
of Computer Notes. if you have any ideas or any request please get @me on Google+
![]()