rb.addActionListener(new ActionEvent(ae) {
public void actionPerformed(ActionEvent ae) {
nowCall(ae);
}
});
另一种方式
Thread th=new Thread(Runnable r) {
public void run() {
// do something
}
};
// notice the ending of above 2 snippets
我非常困惑这两个东西。似乎没有确切的模式来声明匿名内部类。
请解释一下匿名内部类的语法。