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
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.
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.
0 comments :
Post a Comment