KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test2 > test2


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