KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test84


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 Test84{
11
12     public static void main(String JavaDoc [] args){
13         Test84 t84 = new Test84();
14         t84.run(5);
15     }
16     
17     public void run(int x){
18         new Helper(){
19             int x = 9;
20             public void action(){
21                 System.out.println("x: "+x);
22             }
23         }.action();
24     }
25 }
26
Popular Tags