Tuesday 26 March 2013

Method overriding rulesin Java

Method overriding rulesin Java:-

1) The signature including the number and type of arguments for the overriding method should be same.

2) The return type should be same.

3) The access modifier should not be more limiting than superclass method.

4) The overriding method should not throw exceptions other than those thrown by the method in the super class.

No comments:

Post a Comment