A. 编译时将产生错误;
B. 编译时正确,运行时将产生错误;
C. 输出0;
D. 输出null。
第1题
A. 3
B. 4
C.5
D.编译错误
E.6
第2题
A. 000
B. 012
C.123
D.111
第3题
以下程序的运行结果为?
class test {
public static void main(String args[]) {
int i,j=0;
for(i=10;i<0;i--) { j++; }
switch(j) {
case (0) : j=j+1;
case ( 1、 : j=j+2; break;
case ( 2、: j=j+3; break;
case (10) : j=j+10; break;
default : break;
}
System.out.println(j);
}
}
A. 0
B. 1
C. 2
D. 3
E. 10
第4题
A. args[0] = "MyTest 1 2 3"
B. args[0] = "1 2 3"
C. args[0] = "1"
D. args[1]= "1 2 3"
第5题
A. 编译错误:anar 在引用前未初始化。
B. null
C. 0
D. 5
第6题
以下程序的运行结果为
class Prob10 {
static boolean b1;
public static void main(String [] args) {
int i1 = 11;
double f1=1.3;
do {
b1 = (f1 >4、&& (i1--< 10);
f1 += 1.0;
} while (!b 1、;
System.out.println(b1 + "," + i1 + "," + f 1、;
}
}
A. false,9,4.3
B. true,11,1.3
C. false,8,1.3
D. true,8,7.3
第8题
设有如下程序,其调试结果为:
class Q2 {
public static void main(String[] args) {
int[] seeds = {1,2,3,4,6,8};
int n= seeds.length;
for (int i = 0; i< 3; i++)
for (int k = 0; k< n-1; k++)
seeds[k]= seeds[k+1];
for (int i = 0; i
System.out.print("/t"+seeds[i]);
}
}
A.输出: 1 2 3 4 6
B.输出: 4 6 8 8 8
C.输出: 2 3 4 6 8
D.输出: 2 3 4 6
第9题
A. for (int i=0; i< ia.length() -1; i++)
B. for (int i=0; i< ia.length(); i++)
C. for (int i=1; i< 4; i++)
D. for (int i=0; i< ia:A.length;i++)
第10题
A. i=6 j=5
B. i=5 j=5
C. i=6 j=4
D. i=5 j=6
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!