Код: Выделить всё
// inside A.java
public class A {
// ...
}
// inside B.java
public class B {
// ...
public void f() { /* ... */ }
public void g() { /* ... */ }
public void h() { /* ... */ }
}
// inside C.java
class C {
// ...
}
// inside Top.java
public class Top {
// ...
private A a;
private B b;
private C c;
public Top(A a, B, b, C c) {
this.a = a;
this.b = b;
this.c = c;
}
}
- необходимо вызвать функции f() и g() из b
Код: Выделить всё
a - необходимо вызвать функции g() и h() из b
Код: Выделить всё
b
Подробнее здесь: https://stackoverflow.com/questions/787 ... ne-another
Мобильная версия