I came across two overloading questions recently that I can\'t find an answer for and don\'t have a java environment to run some test code. I\'m hoping someone can help me b
First question:
Your assumption is correct. The second call to f()
will call the varargs method. You can get the compiler to call the second method with:
private void f(int a) {
f(a, null);
}
Second question:
Yes. However, you can't extend an interface. If you change A
to an abstract class, things will compile.