public class Printer {
public String show(int n) { return "int"; }
public String show(int n, int m) { return "two"; }
}
// ...
Printer p = new Printer();
System.out.println(p.show(7));What is printed?
- A
Compile-time error
- B
two
- C
7
- Dcheck_circle
int
Explanation
The overload selected matches by number of parameters; show(int) is called.