Java Method Overloading Properties
The OverloadExample class shown below demonstrates method overloading.
public class OverloadExample {
public void doSomething(int a) {
System.out.println(a);
}
public void doSomething(String s) {
System.out.println(s);
}
}
All of the following statements about method overloading in Java are true EXCEPT:
A
Method overloading allows multiple methods to have the same name, providing different implementations through varied parameter lists.
B
Overloaded methods share the same name but have different parameter types or a different number of parameters.
C
Method overloading occurs when two methods have the same name and exactly the same parameter list.
D
The decision on which overloaded method to call is made at compile time based on the argument types.
Question Leaderboard
Not enough data yet to show leaderboard.
