KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test43


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