1.普通类
public class Executor {
public void execute(){
System.out.println("Executor ---> execute");
}
}
2.测试类
public class Test {
public static void main(String[] args) {
Executor executor = new Executor(){
public void execute(){
System.out.println("Do something...");
}
};
executor.execute();
}
}
Java回调函数实现的灵魂...