假设我有一个具体类Class1,并且我正在将其创建为匿名类。
Object a = new Class1(){
void someNewMethod(){
}
};
现在是否有任何方法可以重载此匿名类的构造函数,就像下面所示:
Now is there any way I could overload the constructor of this anonymous class. Like shown below
Object a = new Class1(){
void someNewMethod(){
}
public XXXXXXXX(int a){
super();
System.out.println(a);
}
};
使用某些内容在 xxxxxxxx 上命名构造函数?