第1题
下列代码中,将引起一个编译错误的行是()。 1)public class Test{ 2) int m,n; 3) public Test(){} 4) public Test(int a){m=a;} 5) public static void main(String args[]){ 6) Test t1,t2; 7) int j,k; 8) j=0;k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12)}
A.第3行
B.第5行
C.第6行
D.第10行
第2题
给出下面代码段:
public class Test{
public static void main(String args[])
{
int m;
switch(m)
{
case 0 :System.out.println("case 0");
case 1 :System.out.println("case 1");
break;
case 2 :break;
default :System.out.println("default");
}
}
}
下列m的值能引起输出“default”的是()。
A.0
B.1
C.2
D.4
第3题
给出下面的代码:
1)public class Test {
2)int m, n;
3)public Test() ()
4)public Test(int a) {m=a; }
5)public static void main(string arg[]) {
6)Test t1,t2;
7)int j,k;
8)j=O; k=0;
9)t1=rlew Test();
10)t2=new Test(j,k);
11)}
12)}
在编译时行将导致一个错误。
A.3 B.5 C.6 D.10
第4题
给出下面代码段: public class Test{ public static void main(String args[] ) { int m; switch(m) { case 0: System.out.println("case 0"); case 1: System.out.println("case 1"); break; case 2: break; default: System.out.println("default"); } } } 下列m的值能引起输出“default”的是()。
A.0
B.1
C.2
D.4
第5题
给出下面代码的输出()
public class Test {
public static void main(String[ ] args) {
int[][] array = {{1, 2, 3, 4},{5, 6, 7, 8}};
System.out.println(m1(array)[1])
}
public static int[] m1(int[][] m){
int[] result = new int[2];
result[0] = m.length;
result[1] = m[0].length;
return result;
}
}
A、0
B、1
C、2
D、4
第6题
下列代码中,将引起编译错误的行是______。 (1) public class Test { (2) int m,n; (3) public Test(){} (4) public Test(int A){m=a;} (5) public static void main(String args[ ]){ (6) Test t1,t2; (7) int j,k; (8) j=0;k=0; (9) t1=new Test(); (10) t2=new Test(j,k); (11) 1 (12) }
A.第3行
B.第5行
C.第6行
D.第10行
第7题
下列代码中,将引起一个编译错误的行是1)public class Test{2) int m,n;3)public Test(){}4)public Test(int a){m=a;}5)public static void main(String args[]){6)Test t1,t2;7)int j,k;8)j=0;k=0;9)t1=new Test();10)t2=new Test(j,k);11) }12) }
A.第3行
B.第5行
C.第6行
D.第10行
第8题
3下列代码中,将引起一个编译错误的行是()。 1)public class Test{ 2)int m,n; 3)public Test(){} 4)public Test(int a){m=a;} 5)public static void main(String args[]){ 6)Test t1,t2; 7)int j,k; 8)j=0; k=0; 9) t1=new Test(); 10)t2=new Test(j,k); 11)} 12)}
A.第3行
B.第5行
C.第6行
D.第10行
第9题
下列代码中,将引起一个编译错误的行是 1) public class Test{ 2) int m,n; 3) public Test(){} 4) public Test(inta){m=a;} 5) public static void main(String args[]){ 6) Test t1,t2; 7) int j,k; 8) j=0;k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12) }
A.第3行
B.第5行
C.第6行
D.第10行
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!