42
420
462
42042
Compilation fails.
An exception is thrown at runtime.
单选题public class TestString 1 { public static void main(String[] args) { String str = “420”; str += 42; System.out.print(str); } } What is the output?()A42B420C462D42042ECompilation fails.FAn exception is thrown at runtime.
点击查看答案
单选题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?()A2B3C12D23E123FCompilation fails.GAn exception is thrown at runtime.
单选题Given: What is the output?()A42B420C462D42042ECompilation fails.FAn 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.