Java Reference
In-Depth Information
public abstract class D implements A {
public abstract void hello();
}
then C would be forced to implement the method hello itself, even though default
implementations exist elsewhere in the hierarchy.
9.4.3. Conflicts and explicit disambiguation
The examples you've seen so far could be resolved using the first two resolution rules. Let's say
now that B doesn't extend A anymore (illustrated in figure 9.7 ) :
Figure 9.7. Implementing two interfaces
public interface A {
void hello() {
System.out.println("Hello from A");
}
}
public interface B {
void hello() {
System.out.println("Hello from B");
}
}
public class C implements B, A { }
Search WWH ::




Custom Search