DulcetAirman icon

Duplicate default methods

DulcetAirman | PRO | 10/09/15 11:05:56 AM UTC | 0 ⭐ | 548 👁️ | Never ⏰ | []
Java |

440 B

|

None

|

0 👍

/

0 👎

// Duplicate default methods named abc with the parameters () and () are inherited from the types C and B
 
abstract class A {
 
}
 
interface B {
 
    default void abc() {
        System.out.println("Interface B");
    }
}
 
interface C {
 
    default void abc() {
        System.out.println("Interface C");
    }
}
 
public class Test extends A implements B, C {
 
    public static void main(final String[] args) {
        final Test t = new Test();
        t.abc();
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎