Which of the following is NOT an example of method overloading in Java ?
2025
Which of the following is NOT an example of method overloading in Java ?
- A.
Methods
- B.
Methods with different parameter types
- C.
Methods with different return types
- D.
Methods with the same name
Attempted by 39 students.
Show answer & explanation
Correct answer: C
Method overloading in Java allows multiple methods to share the same name within a class, provided they have different parameter lists. This means options B and D describe valid aspects of overloading: methods must share the same name (D) but differ in parameter types or counts (B). Option A is incomplete as a standalone concept. However, option C states that methods with different return types alone constitute overloading, which is incorrect. Java does not consider return type differences when determining method signatures for overloading purposes; the compiler cannot distinguish between methods based solely on return type. Therefore, changing only the return type while keeping parameters identical results in a compilation error rather than valid overloading. This makes option C the correct choice as it is NOT an example of method overloading.