null
finally
null finally
Compilation fails.
finally exception
String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?() A、 abcB、 nullC、 abcdefD、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.
点击查看答案
Given: String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0] : null; What is the result?()A、Compilation fails.B、An exception is thrown at runtime.C、The variable first is set to null.D、The variable first is set to elements[0].
单选题static void test() { try { String x=null; System.out.print(x.toString() +“ “); } finally { System.out.print(“finally “); } } public static void main(String[] args) { try { test(); } catch (Exception ex) { System.out.print(”exception “); } } What is the result?()AnullBfinallyCnull finallyDCompilation fails.Efinally exception
单选题Given: What is the result?()AcollieBharrierCCompilation fails.Dcollie harrierEAn exception is thrown at runtime.
单选题Given: What is the result?()Ar, t, t,Br, e, o,CCompilation fails.DAn exception is thrown at runtime.
单选题Given: What is the result?()ABBB, followed by an Exception.CCompilation fails due to an error on line 9.DCompilation fails due to an error on line 14.EAn Exception is thrown with no other output.
单选题String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?()AabcBnullCabcdefDCompilation fails.EThe code runs with no output.FAn exception is thrown at runtime.