mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-23 18:03:06 +07:00
23 lines
506 B
Java
23 lines
506 B
Java
class Usage {
|
|
private A myA = new A();
|
|
public void methodExpectingI(I i) {
|
|
i.methodFromI();
|
|
}
|
|
|
|
public J methodReturningJ() {
|
|
return myA.getMyDelegate();
|
|
}
|
|
|
|
public void methodExpectingJ(J j) {
|
|
j.methodFromJ();
|
|
}
|
|
|
|
public void main() {
|
|
A a = new A();
|
|
a.methodFromI();
|
|
a.getMyDelegate().methodFromJ();
|
|
methodExpectingI(a);
|
|
methodExpectingJ(a.getMyDelegate());
|
|
methodExpectingJ(myA.getMyDelegate());
|
|
}
|
|
} |