KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test16


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