/** Show various forms of nested classes */
class A extends Object {
public class B { // member class
}
public void print() {
class C { // local class
}
Object d = new Object() {
// anonymous inner class
};
System.out.println("Here are an A, a B, a C, and d.");
System.out.println(this + " " + new B() + " " +
new C() + " " + d);
}
public static void main(String[] av) {
new A().print();
}
}
|