考虑如下类:
publicclassTest{
intj,k;
publicTest(intj){
this(j,0);
}
publicTest(intj,intk){
this.j=j;
this.k=k;
}
}
以下哪些可正确创建Test对象?
A.Testt=newTest();
B.Testt=newTest(l);
C.Testt=newTest(l,2);
D.Testt=newTest(l,2,3);
正确答案:BC
考虑如下类:
publicclassTest{
intj,k;
publicTest(intj){
this(j,0);
}
publicTest(intj,intk){
this.j=j;
this.k=k;
}
}
以下哪些可正确创建Test对象?
A.Testt=newTest();
B.Testt=newTest(l);
C.Testt=newTest(l,2);
D.Testt=newTest(l,2,3);
正确答案:BC