What restrictions are placed on method overloading and
method overriding?

Answer Posted / muthusenthil

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 imposed on Method Overriding are
a) should done with its derived class
b) should have same name of parent method and arguments
too.

Is This Answer Correct ?    34 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a generic data type?

732


What is append function?

752


What is hash code collision?

792


What is parsing a sentence?

750


How to disable caching on back button of the browser?

734


Can you call one constructor from another if a class has multiple constructors?

778


How does remove work in java?

711


Can memory leak happen java?

776


What is collection sort in java?

752


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

797


What access modifiers can be used for variables?

797


How do you start a thread?

758


Difference between keyword and identifier.

772


Where is jre installed?

792


Can we have 2 main methods in java class?

737