Код: Выделить всё
public interface A {
int f();
}
public interface B {
int f();
}
public class C implements A, B {
// ???
}
Код: Выделить всё
C c = new C();
// return values doesn't matter
c.f(); // must print "C"
((A)c).f(); // must print "A"
((B)c).f(); // must print "B"
Код: Выделить всё
// "print" prints first argument to the console
public class C : A, B {
public int f() { print("C"); }
public int A.f() { print("A"); }
public int B.f() { print("B"); }
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... nt-methods