--%>

Explain Method overriding

Method overriding: It is a method stated in a super class might be overridden by a method of similar name stated in a sub class. The two methods should have similar name and number and types of formal arguments. Any checked exception thrown by sub-class version should match the type of one thrown by the super class version, or be a sub-class of this exception. Though, the sub-class version does not encompass to throw any exceptions which are thrown by the super class version. This is significant to distinguish between method overloading and method overriding. Overloaded methods have similar names; however differ in their formal arguments.

   Related Questions in Programming Languages