KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test77


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 Test77{
11
12     public static void main(String JavaDoc [] args){
13         Test77 t77 = new Test77();
14         t77.run(5);
15     }
16     
17     public void run(final int x){
18         new Helper(){
19         
20             public void action(){
21                 
22                 class MyHelper1 {
23                     public void action(){
24                         System.out.println(x);
25
26                         new Helper(){
27                             public void run(final int y){
28                                 System.out.println(x*x);
29                                 class MyHelper2{
30                                     public void action(){
31                                         System.out.println(x*y*x*x*x);
32                                     }
33                                 };
34                                 MyHelper2 m2 = new MyHelper2();
35                                 m2.action();
36                             }
37                         }.run(7);
38                     }
39                 };
40                 MyHelper1 m1 = new MyHelper1();
41                 m1.action();
42             }
43         }.action();
44     }
45 }
46
Popular Tags