KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test19


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
11 public class Test19 {
12
13     public static void main (String JavaDoc [] args){
14         Test19 t19 = new Test19();
15         t19.run();
16     }
17
18     public void run(){
19         final String JavaDoc atMe = getString();
20         new Helper () {
21             public void action(){
22                 System.out.println("Smile: "+atMe);
23             }
24         }.action();
25     }
26
27     public String JavaDoc getString(){
28         return "atMe";
29     }
30 }
31
Popular Tags