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.

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.


相关考题:

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.

publicclassTest{publicstaticvoidleftshift(inti,intj){i=j;}publicstaticvoidmain(Stringargs[]){inti=4,j=2;leftshift(i,j);System.out.printIn(i);}}Whatistheresult?() A.2B.4C.8D.16E.Thecodewillnotcompile.

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.

publicclassTest{publicstaticvoidleftshift(inti,intj){i=j;}publicstaticvoidmain(Stringargs){inti=4,j=2;leftshift(i,j);System.out.printIn(i);}}Whatistheresult?() A.2B.4C.8D.16E.Thecodewillnotcompile.

publicclassFoo{publicstaticvoidmain(Stringargs){inti=1;intj=i++;if((i++j)(i++==j)){i+=j;}}}Whatisthefinalvalueofi?() A.1B.2C.3D.4E.5

下列程序的执行结果为( )。 public class c3 { public static void main(String args[]) { int i=13,j=10; if(i--j) i++: elsej--; System.out.println(i+"\t"+j); } }A.13 10B.12 11C.11 11D.12 12

下面程序的输出结果是什么? public class cs6 { public static void main(String args[]) { int i =1; int j =10; do{ if(i++<j--) continue; }while(i<5); System.out.println(i+","+j); } }