inti=1,j=-1;switch(i){case0,1:j=1;case2:j=2;default;j=0;}System.out.println(j=”+j);Whatistheresult?() A.j=-1B.j=0C.j=1D.j=2E.Compilationfails.

inti=1,j=-1;switch(i){case0,1:j=1;case2:j=2;default;j=0;}System.out.println(j=”+j);Whatistheresult?()

A.j=-1

B.j=0

C.j=1

D.j=2

E.Compilationfails.


相关考题:

publicclassTest{publicstaticvoidmain(StringArgs[]){inti=1,j=0;switch(i){case2:j+=6;case4:j+=1;default:j+=2;case0:j+=4;}System.out.println(j=”+j);}}Whatistheresult?() A.0B.2C.4D.6E.9F.13

intI=1,j=0switch(i){case2:j+=6;case4:j+=1;default:j+=2;case0:j+=4;}Whatisthevalueofjatline16?() A.0B.1C.2D.4E.6

给定程序段,求输出结果。 int i=1,j=0; switch(i){ case 2: j+=6; case 4: j+=1; default: j+=2; case 0: j+=4; } System.out.println(j);A.6B.1C.2D.4

已知int i=1,j=0;执行下面语句后j的值是____。    while(i) switch(i) { case 1: i+=1;j++;break; case 2: i+=2;j++;break; case 3: i+=3;j++;break; default: i--;j++;break;}A.1B.2C.3D.死循环

10、给定Java代码片断,如下: int i=0,j=-1; switch(i) { case 0,1:j=1; case 2:j=2; } System.out.print("j="+j); 编译运行,正确的结果是()。A.程序编译出错B.j=1C.j=2D.j=0

已知int i=1,j=0;执行下面语句后j的值是____。    while(i) switch(i) { case 1: i+=1;j++;break; case 2: i+=2;j++;break; case 3: i+=3;j++;break; default: i--;j++;break;}A.死循环B.1C.2D.3

已知int i=1,j=0;执行下面语句后j的值是____。 while(i) switch(i) { case 1: i+=1;j++;break; case 2: i+=2;j++;break; case 3: i+=3;j++;break; default: i--;j++; break; }A.1B.2C.3D.死循环

4、给定程序段,求输出结果。 int i=1,j=0; switch(i){ case 2: j+=6; case 4: j+=1; default: j+=2; case 0: j+=4; } System.out.println(j);A.6B.1C.2D.4

3、给定下面程序段,输出结果是()。 int i= 1, j = 0; switch(i){ case 1 : j += 6; case 2 : j += 1; default : j += 2; } System.out.println(j); A.2 B.6 C.7 D.9