class OverloadingVarargs2 {
static void f(float i, Character... args) {
System.out.println("first");
System.out.println(i);
}
static void f(Character... args) {
System.out.println("second");
}
static void test() {
f(1, 'a');
f('b', 'c'); // the method f is ambiguous
}
}
This code can't be compiled, The compiler says that f is ambiguous. But I think the second method can match f('b', 'c');
what's the problem?