KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test39


1 interface MyListener {
2
3     public void action();
4 }
5 public class Test39{
6
7     public static void main(String JavaDoc [] args){
8         Test39 t39 = new Test39();
9         t39.run();
10     }
11
12     public void run(){
13         new MyListener(){
14             public void action(){
15                 System.out.println("Test39 anon1");
16             }
17         };
18         TopLevel1 tl1 = new TopLevel1();
19         tl1.run();
20     }
21 }
22 class TopLevel1{
23
24     public void run(){
25         new MyListener(){
26             public void action(){
27                 System.out.println("TopLevel1 anon1");
28             }
29         };
30     }
31 }
32
Popular Tags