A.NULL
B.Compilationfails.
C.Thecoderunswithnooutput.
D.Anexceptionisthrownatruntime.
NULLshouldbe"null".
第1题:
A.0
B.null
C.Compilationfails.
D.ANullPointerExceptionisthrownatruntime.
E.AnArrayIndexOutOfBoundsExceptionisthrownatruntime.
第2题:
下面代码的运行结果是( )。 public class ConcatTest { public static void main (String[ ] args) { String str1 = "abc"; String str2 = "ABC"; String str3 = str1. coneat(str2); System. out. println(str3); } }
A.abc
B.ABC
C.abcABC
D.ABCabc
第3题:
以下程序段输出的结果是() public class test { public static void main(String[] args) { String str = "ABCDE"; str.substring(3); str.concat("XYZ"); System.out.println(str ); } }
A.DE
B.DEXYZ
C.ABCDE
D.CDEXYZ
第4题:
A.finished
B.Compilationfails.
C.AnAssertionErroristhrown.
D.AnAssertionErroristhrownandfinishedisoutput.
Thisquestionisabittrickybecauseitlacksthefollowinginformation:Itshouldincludeastatementthatsayswhetherornotassertionsareenabled.Iftheyareindeedenabled,the
correctionanswerisC.butiftheyarenot,thecorrectanswerisA.Assertionsarenotenabledbydefaultsoifthequestionisnotchanged,themostlogicalanswerisA.
第5题:
以下程序段输出的结果是() public class Test{ public static void main(String[] args) { String str=”ABCDE”; str.substring(3); str.concat(“XYZ”); System.out.println(str); } }
A.DE
B.DEXYZ
C.ABCDE
D.CDEXYZ