网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
publicclassX{publicstaticvoidmain(String[]args){byteb=127;bytec=126;byted=b+c;}}Whichstatementistrue?()

A.Compilationsucceedsanddtakesthevalue253.

B.Line5containsanerrorthatpreventscompilation.

C.Line5throwsanexceptionindicating“Outofrange”

D.Line3and4containerrorthatpreventcompilation.

E.Thecompilationsucceedsanddtakesthevalueof1.


参考答案

更多 “ publicclassX{publicstaticvoidmain(String[]args){byteb=127;bytec=126;byted=b+c;}}Whichstatementistrue?() A.Compilationsucceedsanddtakesthevalue253.B.Line5containsanerrorthatpreventscompilation.C.Line5throwsanexceptionindicating“Outofrange”D.Line3and4containerrorthatpreventcompilation.E.Thecompilationsucceedsanddtakesthevalueof1. ” 相关考题
考题 以下是JAVA中正确的入口方法是?() A.publicstaticvoidmain(String[]args){}B.publicstaticvoidmain(Stringargs){}C.publicvoidmain(String[]args){}D.publicstaticintmain(String[]args){}

考题 下面main()方法的定义哪些是正确的()。A.publicstaticvoidmain(Stringargs[]){}B.publicstaticvoidmain(String[]){}C.publicstaticvoidmain(String[]args){}D.publicstaticvoidmain(String[]x){}

考题 现有2个文件:packagex;publicclassX{publicstaticvoiddoX(){System.out.print(doX);}}和:classFind{publicstaticvoidmain(String[]args){//insertcodehere}}哪两行分别插入到类Find的第3行将编译并产生输出doX”?() A.doX();B.X.doX();C.x.X.doX();D.x.XmyX=newx.X();myX.doX();

考题 publicclassTest{2.publicstaticvoidmain(String[]args){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?() A.-1B.255C.127D.Compilationwillfail.E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.

考题 publicclassX{publicstaticvoidmain(String[]args){strings=newstring(Hello”);modify(s);System.out.printIn(s);}publicstaticvoidmodify(Strings){s+=world!”;}}Whatistheresult?() A.Theprogramrunsandprints“Hello”B.Anerrorcausescompilationtofail.C.Theprogramrunsandprints“Helloworld!”D.Theprogramrunsbutabortswithanexception.

考题 publicclassX{publicstaticvoidmain(String[]args){Strings1=newString(true”);Booleanb1=newBoolean(true);if(s2.equals(b1)){System.out.printIn(Equal”);}}}Whatistheresult?() A.Theprogramrunsandprintsnothing.B.Theprogramrunsandprints“Equal”C.Anerroratline5causescompilationtofail.D.Theprogramrunsbutabortswithanexception.

考题 publicclassTest{publicstaticvoidmain(String[]args){System.out.println(args.length4args[4].equals(-d”));}}Iftheprogramisinvokedusingthecommandline:javaTestOneTwoThree–dWhatistheresult?() A.trueB.falseC.Compilationfails.D.Anexceptionisthrownatruntime.

考题 publicclassAlpha{publicstaticvoidmain(string[]args){if(args.length==2){if(args.[0].equalsIgnoreCase(-b”))System.out.println(newBoolean(args[1]));}}}Andthecodeisinvokedbyusingthecommand:javaAlpha–bTRUEWhatistheresult?()A.trueB.nullC.falseD.Compilationfails.E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

考题 publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(C”);}finally{System.out.print(B”);}System.out.print(D”);}publicstaticvoidbadMethod(){thrownewError();}}Whatistheresult?()A.ABCDB.Compilationfails.C.Cisprintedbeforeexitingwithanerrormessage.D.BCisprintedbeforeexitingwithanerrormessage.E.BCDisprintedbeforeexitingwithanerrormessage.

考题 publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(RuntimeExceptionex){System.out.print(B”);}catch(Exceptionex1){System.out.print(C”);}finally{System.out.print(D”);}System.out.print(E”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()A.BDB.BCDC.BDED.BCDEE.ABCDEF.Compilationfails.

考题 publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()A.ABB.BCC.ABCD.BCDE.Compilationfails.

考题 publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){}}Whatistheresult?()A.ACB.BDC.ACDD.ABCDE.Compilationfails.

考题 publicclassX{publicstaticvoidmain(Stringargs){byteb=127;bytec=126;byted=b+c;}}Whichstatementistrue?() A.Compilationsucceedsanddtakesthevalue253.B.Line5containsanerrorthatpreventscompilation.C.Line5throwsanexceptionindicating“Outofrange”D.Line3and4containerrorthatpreventcompilation.E.Thecompilationsucceedsanddtakesthevalueof1.

考题 作为Java应用程序入口的main方法,其声明格式可以是( )。A、publicstaticvoidmain(String[]args)B、publicstaticintmain(String[]args)C、publicvoidmain(String[]args)D、publicintmain(String[]args)

考题 一幅30×20的彩色图像(8bit/像素),其数据量为()。 A、600byteB、4800byteC、240byteD、160byte

考题 如果不考虑IP报文头的option字段,IP报文的头部为多大?()A、20byteB、60byteC、16byteD、32byte

考题 IP数据报最大的长度为:()字节。A、20byteB、65535byteC、2000byteD、216-1单位

考题 IP数据报头最大与最小的字节长度可能为:()。A、5byteB、20byteC、53byteD、15单位

考题 最大IP数据报的字节数为:()。A、1600 byteB、2048 byteC、216-1 byteD、65535 byte

考题 若有byteb=6;charc=’c’;则表达式b+c的值的类型是()A、intB、byteC、charD、float

考题 在常规下以太网数据帧的最大的长度为:()字节。A、1518byteB、65535byteC、2000byteD、64byte

考题 Lapd信道上发送消息数据包的最大长度为()A、32byteB、64byteC、256byteD、255byte

考题 ATM信元的长度为()A、47byteB、48byteC、53byteD、54byte

考题 360KB的软盘存储量为()。A、360×100 ByteB、360×1000 ByteC、360×1 ByteD、360×1024 Byte

考题 依统计规律,若一个文件用英文ASCII码存放需要1000Byte,则用汉字内码存放时所占字节数是()。A、541ByteB、1000ByteC、1850ByteD、无法估计

考题 IP数据报头的字节长度可能为:()。A、5byteB、20byteC、53byteD、20单位

考题 单选题依统计规律,若一个文件用英文ASCII码存放需要1000Byte,则用汉字内码存放时所占字节数是()。A 541ByteB 1000ByteC 1850ByteD 无法估计