41 lines
350 B
Java
Executable File
41 lines
350 B
Java
Executable File
/*
|
|
|
|
<i>A
|
|
<i>B <i>C
|
|
D
|
|
*/
|
|
|
|
interface A{
|
|
fooA();
|
|
}
|
|
|
|
interface B extends A{
|
|
fooB();
|
|
}
|
|
|
|
interface C extends A{}
|
|
|
|
class D implements B,C {
|
|
fooA() {
|
|
}
|
|
fooB() {
|
|
}
|
|
}
|
|
|
|
public class TestInheritanceCircle{
|
|
|
|
public m1(x) {
|
|
x.fooA();
|
|
/*return x;*/
|
|
}
|
|
|
|
public m2(x) {
|
|
x.fooB();
|
|
/*return x;*/
|
|
}
|
|
public m3(D x) {
|
|
x.fooA();
|
|
return x;
|
|
}
|
|
|
|
} |