interface A{ default void foo(){ System.out.println("A"); }} interface B{ default void foo(){ System.out.println("B"); }} class C implements A, B{} class Ideone{ public static void main (String[] args) throws java.lang.Exception { C c = new C(); c.foo(); }}
Standard input is empty
Main.java:13: error: types A and B are incompatible; class C implements A, B{ ^ class C inherits unrelated defaults for foo() from types A and B 1 error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!