fork(1) download
  1. interface A{
  2. default void foo(){
  3. System.out.println("A");
  4. }
  5. }
  6.  
  7. interface B{
  8. default void foo(){
  9. System.out.println("B");
  10. }
  11. }
  12.  
  13. class C implements A, B{
  14. }
  15.  
  16. class Ideone
  17. {
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. C c = new C();
  21. c.foo();
  22. }
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty