public class Test {
private int i,j;
public Test() {
}
public Test(int i) {
this.i = i;
}
public static void main(String[] args) {
Test t=new Test();
Test t1=new Test(0,0);
t1.Test(10);
}
}
Test t1=new Test(0,0);没有对应的构造函数呀
你这个?我虽然不知道你在干啥,但是应该是想这样吧
public class Test {
private int i,j;
public Test() {
}
public Test(int i) {
this.i = i;
}
public static void main(String[] args) {
Test t=new Test();
Test t1=new Test(10);
}
}
这样就可以了,望采纳。