publicclass MainClass {
class A {
privateint i = 11;
publicint value() {
return i;
}
}
class B {
private String label;
B(String whereTo) {
label = whereTo;
}
String readLabel() {
return label;
}
}
// Using inner classes looks just like
// using any other class, within MainClass:
publicvoid ship(String dest) {
A c = new A();
B d = new B(dest);
System.out.println(d.readLabel());
}
publicstaticvoid main(String[] args) {
MainClass p = new MainClass();
p.ship("AAA");
}
}