publicclassTest{2.publicstaticvoidmain(String[]args){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?() A.-1B.255C.127D.Compilationwillfail.E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.
publicclassTest{2.publicstaticvoidmain(String[]args){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?()
A.-1
B.255
C.127
D.Compilationwillfail.
E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.
相关考题:
publicclassArrayTest{2.publicstaticvoidmain(String[]args){3.floatf1[],f2[];4.f1=newfloat[10];5.f2=f1;6.System.out.printIn(f2[0]=”+f2[0]);7.}8.}Whatistheresult?() A.Itprintsf2[0]=0.0B.Itprintsf2[0]=NaNC.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexceptionatruntime.
publicclasstest(2.publicstaticvoidmain(Stringargs[]){3.inti=0xFFFFFFF1;4.intj=~i;5.6.}7.)Whatisthedecimalvalueofjatline5?() A.0B.1C.14D.–15E.Anerroratline3causescompilationtofail.F.Anerroratline4causescompilationtofail.
publicclassTest{privatestaticint[]x;publicstaticvoidmain(String[]args){System.out.println(x[0]);}}Whatistheresult?() A.0B.nullC.Compilationfails.D.ANullPointerExceptionisthrownatruntime.E.AnArrayIndexOutOfBoundsExceptionisthrownatruntime.
publicclassTest{publicstaticvoidmain(String[]args){intx=0;assert(x0)?assertionfailed”:assertionpassed”;System.out.println(Finished”);}}Whatistheresult?() A.finishedB.Compilationfails.C.AnAssertionErroristhrownandfinishedisoutput.D.AnAssertionErroristhrownwiththemessage“assertionfailed”.E.AnAssertionErroristhrownwiththemessage“assertionpassed”.
publicclassTest{publicstaticvoidmain(String[]args){intx=0;assert(x>0):“assertionfailed”;System.out.println(“finished”);}}Whatistheresult?() A.finishedB.Compilationfails.C.AnAssertionErroristhrown.D.AnAssertionErroristhrownandfinishedisoutput.
publicclassTest{2.publicstaticvoidmain(Stringargs){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?() A.-1B.255C.127D.Compilationwillfail.E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.
阅读下面代码 public class Test { public static void main(String[]args) { System.out.println(2>0?10:8); } } 其运行的结果是A.2B.0C.10D.8
阅读下面的程序public class Test {public static void main(String[] args) {for(int x = 0 ; x A.跳出循环,无输出B.0121C.01D.0123
2、1、写出以下程序的输出内容。 public class Test { public static void changeValue(int value){ value = 0; } public static void main(String[] args) { int value = 2010; changeValue(value); System.out.println(value); } }