KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test31


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