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 value is a variable of the string type automatically initialized?

615


What is comparator in java?

559


If a method is declared as protected, where may the method be accessed in java programming?

498


What is the difference between abstraction and encapsulation?

565


What all access modifiers are allowed for top class ?

713






Can we write a class without main method in java?

487


What is the advantage of OOP in java?

663


What is collection class in java? List down its methods and interfaces.

534


Which class is the superclass of all classes?

604


Can a class be declared as static?

683


Explain parallel processing in java8?

637


describe method overloading

540


In how many ways we can do synchronization in java?

529


why java does not support unsigned keyword?

4264


What is parameter example?

547