publicclasstest{publicstaticvoidmain(String[]a){asserta.length==1;}}WhichtwowillproduceanAssertionError?() A.javatestB.java-eatestC.javatestfile1D.java-eatestfile1E.java-eatestfile1file2F.java-ea:testtestfile1
publicclasstest{publicstaticvoidmain(String[]a){asserta.length==1;}}WhichtwowillproduceanAssertionError?()
A.javatest
B.java-eatest
C.javatestfile1
D.java-eatestfile1
E.java-eatestfile1file2
F.java-ea:testtestfile1
相关考题:
下面程序的输出结果是()publicclassTest{publicstaticvoidmain(String[]args){Strings=abcdsfghi”;String[]arr=s.split(\s”);System.out.println(arr.length);}} A.编译报错B.2C.1D.3
下列程序的输出结果是( )。 public class Test { public static void main(String[] args) { char a1 = 'B', a2 = 'c'; if(a1+1<a2) ++a1; System.out.println(a1); } }A.BB.bC.CD.c
publicclassTest{2.publicstaticvoidmain(String[]args){3.unsignedbyteb=0;4.b--;5.6.}7.}Whatisthevalueofbatline5?() A.-1B.255C.127D.Compilationwillfail.E.Compilationwillsucceedbuttheprogramwillthrowanexceptionatline4.
publicclassTest{publicstaticvoidmain(String[]args){Stringstr=NULL;System.out.println(str);}}Whatistheresult?() A.NULLB.Compilationfails.C.Thecoderunswithnooutput.D.Anexceptionisthrownatruntime.
publicclassTest{privatestaticint[]x;publicstaticvoidmain(String[]args){System.out.println(x[0]);}}Whatistheresult?() A.0B.nullC.Compilationfails.D.ANullPointerExceptionisthrownatruntime.E.AnArrayIndexOutOfBoundsExceptionisthrownatruntime.
packagetest1;publicclassTest1{staticintx=42;}packagetest2;publicclassTest2extendstest1.Test1{publicstaticvoidmain(String[]args){System.out.println(x=+x);}}Whatistheresult?() A.x=0B.x=42C.Compilationfailsbecauseofanerrorinline2ofclassTest2.D.Compilationfailsbecauseofanerrorinline3ofclassTest1.E.Compilationfailsbecauseofanerrorinline4ofclassTest2.
Given:Andthefollowingfivefragments:publicstaticvoidmain(String...a){publicstaticvoidmain(String.*a){publicstaticvoidmain(String...a){publicstaticvoidmain(String[]...a){publicstaticvoidmain(String...[]a){Howmanyofthecodefragments,insertedindependentlyatline2,compile?()A.0B.1C.2D.3E.4
下面的程序会抛出什么异常类型? public class Test { public static void main(String[] args) { Object o = new Object(); String d = (String)o; } }A.ArithmeticExceptionB.ArrayIndexOutOfBoundsExceptionC.StringIndexOutOfBoundsExceptionD.ClassCastException
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); } }