public class MainClass {
class A {
private int i = 11;
public int value() {
return i;
}
}
class B {
private String label;
B(String whereTo) {
label = whereTo;
}
String readLabel() {
return label;
}
}
public B to(String s) {
return new B(s);
}
public A cont() {
return new A();
}
public void ship(String dest) {
A c = cont();
B d = to(dest);
System.out.println(d.readLabel());
}
public static void main(String[] args) {
MainClass p = new MainClass();
p.ship("A");
MainClass q = new MainClass();
MainClass.A c = q.cont();
MainClass.B d = q.to("A");
}
}
|