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 ?

Answer: C. Methods with different return typesMethod overloading in Java allows multiple methods to share the same name within a class, provided they have different parameter lists. This means options B…

  1. A.

    Methods

  2. B.

    Methods with different parameter types

  3. C.

    Methods with different return types

  4. D.

    Methods with the same name

Attempted by 168 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.

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…