日期:2014-05-20 浏览次数:20919 次
public void click(){
JButton jb = new JButton();
jb.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
});
}
package csdn.examples;
public class Test {
public static void main(String[] args) {
class LocalClass {
void printMessage(){
System.out.println("This is a local class.");
}
}
LocalClass local = new LocalClass();
local.printMessage();
Object o = new Object(){
@Override public String toString(){
return "Hello";
}
};
System.out.println(o);
}
}