KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test7


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