Advertisements
Advertisements
Question
Overloading of methods even depends on return type.
Options
True
False
MCQ
True or False
Solution
This statement is False.
Explanation:
- In Java, method overloading is independent of return type.
- Overloaded methods are those that have the following:
- It has the same name, but
- Different parameter lists (quantity, kind, and order of parameters).
- The return type alone cannot distinguish between overloaded methods since the compiler utilizes the method signature (name + parameter list) to determine which method to invoke.
shaalaa.com
Is there an error in this question or solution?