1)class XYZ {
void method(int i) {} // line (1)
void method(float f) {} // line (2)
public static void main(
String[] args) {
new XYZ().method(2); // line (3)
}
}
In line (3) is their a Question of applicable methods.
or is compiler going to select directly method in line (1) as the method call in line (3) matches exactly with method signature in line (1)?
2) class ABC {
void method(String s) {} // line (1)
void method(Object o) {} // line (2)
public static void main(String[] args) {
new ABC().method("ABC"); // line (3)
}
}
Same kind of Question.
In line (3) is their a Question of applicable methods.
or is compiler going to select directly method in line (1) as the method call in line (3) matches exactly with method signature in line (1)?
Thanks in Advance.