Name: diC59631 Date: 01/28/98
Compile the following:
interface F1 { void method (); }
interface F2 { void method (); }
interface F3 extends F1 /*, F2 */ {}
class C implements F3 {
public void method () { System.out.println("So there!"); }
}
public class Hello {
public static void main (String[] args) {
F3 f = new C();
f.method();
}
}
Note, however, if you remove the comments around ", F2 " in the definition
of F3, you will get a compiler error, which is inconsistent with the Java
language spec.
Error: C:\rich\bugs\Hello.java(12): Reference to method is ambiguous. It is defined in void method() and void method().
As far as I can see in the Java language spec, this is a totally valid program.
(Review ID: 24108)
======================================================================
- duplicates
-
JDK-4030955 Identical signatures cause ambiguity during overload resolution
- Closed