public class B {
public int test(int i){return 1;};
public int test(float i){return 2;};
public int test(Integer i){return 3;};
public static void main(String[] args) {
B b = new B();
System.out.printf("%d %d %d", b.test(1), b.test(1.0f),
b.test(Integer.valueOf(1)));
}
}
Ответ
Output: 1 2 3
Класс скомпилируется и будет работать, т.к. значения считаются разными и попадут в нужные методы