public class K {
public void f(int x) { System.out.print("int "); }
public void f(Object x) { System.out.print("obj "); }
}
// ...
K k = new K();
k.f(7);
k.f("a");What is printed?
- A
obj obj
- Bcheck_circle
int obj
- C
int int
- D
obj int
Explanation
7 matches f(int) exactly; "a" is a String which is an Object, matching f(Object).