KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test48


1 interface MyListener {
2     public void action();
3 }
4 public class Test48 {
5
6     public static void main (String JavaDoc [] args){
7         Test48 t48 = new Test48();
8         t48.run();
9     }
10
11     public void run(){
12         final String JavaDoc atMe = getString();
13         new MyListener () {
14             public void action(){
15                 System.out.println("Smile: ");
16             }
17         }.action();
18         System.out.println(atMe);
19     }
20
21     public String JavaDoc getString(){
22         return "atMe";
23     }
24 }
25
Popular Tags