网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
publicclasstest(2.publicstaticvoidmain(stringargs[]){3.int1=0;4.while(i){5.if(i==4){6.break;7.}8.++i;9.}10.11.}12.)Whatisthevalueofiatline10?()
A.0
B.3
C.4
D.5
E.Thecodewillnotcompile.
参考答案
更多 “ publicclasstest(2.publicstaticvoidmain(stringargs[]){3.int1=0;4.while(i){5.if(i==4){6.break;7.}8.++i;9.}10.11.}12.)Whatisthevalueofiatline10?() A.0B.3C.4D.5E.Thecodewillnotcompile. ” 相关考题
考题
publicclassTest{2.publicstaticvoidmain(Stringargs[]){3.classFoo{4.publicinti=3;5.}6.Objecto=(Object)newFoo();7.Foofoo=(Foo)o;8.System.out.printIn(foo.i);9.}10.}Whatistheresult?()
A.Compilationwillfail.B.Compilationwillsucceedandtheprogramwillprint“3”C.CompilationwillsucceedbuttheprogramwillthrowaClassCastExceptionatline6.D.CompilationwillsucceedbuttheprogramwillthrowaClassCastExceptionatline7.
考题
publicclasstest(2.publicstaticvoidmain(Stringargs[]){3.inti=0xFFFFFFF1;4.intj=~i;5.6.}7.)Whatisthedecimalvalueofjatline5?()
A.0B.1C.14D.–15E.Anerroratline3causescompilationtofail.F.Anerroratline4causescompilationtofail.
考题
1.classExc0extendsException{}2.classExc1extendsExc0{}3.publicclassTest{4.publicstaticvoidmain(Stringargs[]){5.try{6.thrownewExc1();7.}catch(Exc0e0){8.System.out.println(Ex0caught”);9.}catch(Exceptione){10.System.out.println(exceptioncaught”);11.}12.}13.}Whatistheresult?()A.Ex0caughtB.exceptioncaughtC.Compilationfailsbecauseofanerroratline2.D.Compilationfailsbecauseofanerroratline6.
考题
publicclassTest{2.publicstaticvoidmain(Stringargs){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?()
A.-1B.255C.127D.Compilationwillfail.E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.
考题
publicclasstest(publicstaticvoidmain(stringargs){int1=0;while(i){if(i==4){break;}++i;}})Whatisthevalueofiatline10?()
A.0B.3C.4D.5E.Thecodewillnotcompile.
考题
下面代码的运行结果是 public class Test{ public static void main(String args[]){ for(int i=0; i<3;i++){ if(i<2) continue; System.out.println(i); } } }A.0B.1C.2D.3
考题
下列程序输出结果为( )。public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System.out.println(a); }}A.0B.2C.3D.4
考题
下列程序输出结果为( )。 public class test { public static void main (String args[]) { int a=0; outer:for(int i=0;i<2;i + +) { for(int j=0;j<2;j+ +) { if(j>i) { continue outer; } a+ +; } } System.out.println(a); } }A.0B.2C.3D.4
考题
下面代码的运行结果是 public class Test{ public static void main(String args[]){ for(int i 0;i<3;i++){ if(i<2) continue; System.out.println(i); } } }A.0B.1C.2D.3
热门标签
最新试卷