网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
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[]a){asserta.length==1;}}WhichtwowillproduceanAssertionError?() A.javatestB.java-eatestC.javatestfile1D.java-eatestfile1E.java-eatestfile1file2F.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); } }
热门标签
最新试卷