|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
An Eclipse developer observed that javac detects an error in the program below, but the Eclipse compiler does not.
interface J {
String foo(Number n);
}
interface K {
Object foo(Number n);
}
public abstract class X implements J, K {
void foo() {
foo(0.0f); // javac error: ambiguous
}
}
class Z extends X {
public String foo(Number f) {
return null;
}
public static void main(String args[]) {
System.out.println(new Z().foo(0.0f));
}
}
|