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;
}
}
publicstaticvoid main(String[] args) {
MainClass p = new MainClass();
// Must use instance of outer class
// to create an instances of the inner class:
MainClass.A c = p.new A();
MainClass.B d = p.new B("A");
}
}