netoops blog

Saturday, 24 August 2013

What restrictions are placed on Method Overloading & Method Overriding?



Answer: Restriction on Method Overloading:
Restriction imposed on Method Overloading are
a) should done with in a same class.
b) it should have same name of overloading method.
c) its arguments or parameter should be different
irrespective of return type
Restriction on Method Overriding:
a) should done with its derived class
b)Overridden methods must have the same name, argument list, and return type.
b)The overriding method may not limit the access of the method it overrides.
c)The overriding method may not throw any exceptions that may not be thrown by the overridden method.

Tech Knowledege
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments :

Post a Comment

 
Subscribe For Free Updates!

We'll not spam mate! We promise.

Become Our Fan on Social Sites!