What is the process of defining two or more methods within same class that have same name but different parameters declaration?

What is the process of defining two or more methods within same class that have same name but different parameters declaration?
A. method overloading
B. method overriding
C. method hiding
D. none of the mentioned
 
Answer: a
Explanation: Two or more methods can have same name as long as their parameters declaration is different, the methods are said to be overloaded and process is called method overloading. Method overloading is a way by which Java implements polymorphism.
 

Tìm kiếm

Back
Top