1 interface MyListener { 2 public void action(); 3 } 4 public class Test73 { 5 6 public static void main (String [] args){ 7 Test73 t73 = new Test73(); 8 t73.run(new Integer (7), new Integer (8), new Integer (9)); 9 } 10 11 public void run(final Object o1, final Object o2, final Object o3){ 12 new MyListener () { 13 public void action(){ 14 System.out.println("Smile: "+o1); 15 } 16 }.action(); 17 new MyListener () { 18 public void action(){ 19 System.out.println("Smile: "+o2); 20 } 21 }.action(); 22 class MyClass { 23 public void action(){ 24 System.out.println("Smile: "+o3); 25 } 26 }; 27 MyClass mc = new MyClass(); 28 mc.action(); 29 } 30 } 31 | Popular Tags |