KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test14


1 interface MyListener {
2     public void action();
3 }
4
5 public class Test14 {
6
7     public static void main (String JavaDoc [] args){
8         Test14 t14 = new Test14();
9         t14.run();
10     }
11
12     public void run(){
13         new MyListener () {
14             public void action(){
15                 System.out.println("Smile");
16             }
17         }.action();
18     }
19 }
20
Popular Tags