网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
publicclassForBar{2.publicstaticvoidmain(String[]args){3.inti=0,j=5;4.tp:for(;;){5.i++;6.for(;;)7.if(i>--j)breaktp;8.}9.system.out.printIn(i=”+i+,j=+j);10.}11.}Whatistheresult?()
A.Theprogramrunsandprints“i=1,j=0”
B.Theprogramrunsandprints“i=1,j=4”
C.Theprogramrunsandprints“i=3,j=4”
D.Theprogramrunsandprints“i=3,j=0”
E.Anerroratline4causescompilationtofail.
F.Anerroratline7causescompilationtofail.
参考答案
更多 “ publicclassForBar{2.publicstaticvoidmain(String[]args){3.inti=0,j=5;4.tp:for(;;){5.i++;6.for(;;)7.if(i--j)breaktp;8.}9.system.out.printIn(i=”+i+,j=+j);10.}11.}Whatistheresult?() A.Theprogramrunsandprints“i=1,j=0”B.Theprogramrunsandprints“i=1,j=4”C.Theprogramrunsandprints“i=3,j=4”D.Theprogramrunsandprints“i=3,j=0”E.Anerroratline4causescompilationtofail.F.Anerroratline7causescompilationtofail. ” 相关考题
考题
请阅读下面程序public class Test {public static void main (String[] args) {int i,j;for (i=1;i<5;i++) {for (j=1;j<=i;j++)system.out.print (i+"X"+j+"="+i*j+" ");System.out.println();}}}程序执行完后,i循环和j循环执行的次数分别是【 】。
考题
publicclassFoo{publicstaticvoidmain(String[]args){inti=1;intj=i++;if((i++j)(i++==j)){i+=j;}}}Whatisthefinalvalueofi?()
A.1B.2C.3D.4E.5
考题
inti=0,j=1;if((i++==1)(j++==2)){i=42;}System.out.println(i=+i+,j=+j);Whatistheresult?()
A.i=1,j=2B.i=1,j=1C.i=42,j=2D.i=42,j=1E.Compilationfails.
考题
inti=0,j=5;tp;for(;;){i++;for(;;){if(i--j){breaktp;breaktp;}}System.out.println(i=”+i,j=”+j);}Whatistheresult?()
A.i=1,j=0B.i=1,j=4C.i=3,j=4D.i=3,j=0E.Compilationfails.
考题
publicclassForBar{publicstaticvoidmain(Stringargs){inti=0,j=5;tp:for(;;){i++;for(;;)if(i--j)breaktp;}system.out.printIn(i=”+i+,j=+j);}}Whatistheresult?()
A.Theprogramrunsandprints“i=1,j=0”B.Theprogramrunsandprints“i=1,j=4”C.Theprogramrunsandprints“i=3,j=4”D.Theprogramrunsandprints“i=3,j=0”E.Anerroratline4causescompilationtofail.F.Anerroratline7causescompilationtofail.
考题
下面语句执行后,i的值是______。 public class Test11 { public static void main(String[] args) { int i=0; for( int j=10; j>5i<5; j-=3,i+=2 ) { i=i+j; } System.out.println (i); } }A.10B.9C.8D.12
考题
控制台应用程序 example.java 如下:public class example{public static void main(String[] args){int i=0, j=9;do{if(i++--j) break;} while(i4);System.out.println("i="+i+" and j="+j);}}
考题
以下程序的输出结果为( )。 public class Main { public static void main(String[] args) { int i=0, j=0, a=6; if((++i>0)||(++j>0)) a++; System.out.println( "i=" +i+", j ="+j+", a="+A; } }A.i=0, j=0, a=6B.i=1, j=1, a=7C.i=1, j=0, a=7D.i=0, j=1, a=7
考题
下列语句执行后,i的值是( )。 public class Test { public static void main(String[ ] args) { int i =0; for(int j=10; j>5i<5; j-=3,i+=2) i=i+j; System.out.println(i); } }A.8B.9C.10D.12
热门标签
最新试卷