1 public class InitTest3 { 2 3 public class Inner1 { 4 public void m() { 5 System.out.println("hello from inner 1"); 6 } 7 } 8 public static void main(String [] args){ 9 InitTest3 it = new InitTest3(); 10 it.run(); 11 new InitTest3().new Inner1 () { 12 public void m() { 13 System.out.println("hello from anon subtype of inner 1"); 14 } 15 }.m(); 16 } 17 18 public void run(){ 19 new Inner1 () { 20 public void m() { 21 System.out.println("hello from anon subtype of inner 1"); 22 } 23 }.m(); 24 } 25 } 26 | Popular Tags |