class One {
Two two() {
return new Two() {
Two(){}
Two(String s) {
System.out.println("s= "+s);
}
};
}
}
class Ajay {
public static void main(String ...strings){
One one=new One();
System.out.println(one.two());
}
}
上面的示例代码不能编译。它说“两个不能解决”。 这段代码有什么问题?要创建匿名内部类
new Two()
有没有问题的代码? – 2011-03-01 10:58:54