// Java does not allow a class to extend multiple classes. Since Java 8, // interfaces can have default function implementations. What does this // mean for classes that implement multiple interfaces? interface I1 { default int f() { return 1; } default void g() { System.out.println(1); } void h(); } interface I2 { default int f() { return 2; } default void g() { System.out.println(2); } void h(); } class multi implements I1, I2 // won't compile unless f, g overriden: { public void h() { System.out.println("multi.h"); } // conflicting default methods must be overriden in concrete class: public int f() { return 3; /* return I1.super.f(); */ } public void g() { I2.super.g(); } // choose to inherit g from I2 public static void main(String[] argv) { multi m = new multi(); m.g(); }//main } /// But it's still not possible to inherit from multiple classes ... or is it? // ASSIGNMENT: Show how to emulate the inheritance of multiple CLASSES in C#.