// Tests anonyomus classes. // Expected result: PASS class A2 { public static void main(String[] args) { System.out.println(new A2() { public String toString() { return "anon A2 #1: " + super.toString(); }}); A2 zzz = new A2() { public String toString() { return "anon A2 #2: " + super.toString(); } }; System.out.println(zzz); } public String toString() { Object a = new Object() { { System.out.println(x); } public String toString() { return "anon Object: Object"; } }; System.out.println(a); return "A2: Object"; } int x = 8; }