Home > DeveloperSection > Interviews > What are the rules (method access permission and exception) that needs to be followed, during method overloading and overriding ?

Posted on    July-01-2015 1:47 AM

 Java Java 
Ratings:
 1 Answer(s)
  627  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-01-2015 1:47 AM

During method Overloading, method name should remain same. But method signature can vary. Components of signature that can vary are:
1.Number of arguments
2.Datatype of arguments
3.Order of arguments

During method Overriding, make sure that the method is not throwing checked exceptions that are new or higher than those declared by the overridden method.But we can't override Static and Final methods.

Don't want to miss updates? Please click the below button!

Follow MindStick