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
What is a generic data type?
What is append function?
What is hash code collision?
What is parsing a sentence?
How to disable caching on back button of the browser?
Can you call one constructor from another if a class has multiple constructors?
How does remove work in java?
Can memory leak happen java?
What is collection sort in java?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
What access modifiers can be used for variables?
How do you start a thread?
Difference between keyword and identifier.
Where is jre installed?
Can we have 2 main methods in java class?