网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
publicclassTestString1{publicstaticvoidmain(String[]args){Stringstr=420”;str+=42;System.out.print(str);}}Whatistheoutput?()

A.42

B.420

C.462

D.42042

E.Compilationfails.

F.Anexceptionisthrownatruntime.


参考答案

更多 “ publicclassTestString1{publicstaticvoidmain(String[]args){Stringstr=420”;str+=42;System.out.print(str);}}Whatistheoutput?() A.42B.420C.462D.42042E.Compilationfails.F.Anexceptionisthrownatruntime. ” 相关考题
考题 阅读下面程序public class ConcatTest{P ublic static void main(String[] args){S tring str1 = " abc " ;S tring str2 = " ABC " ;S tring str3 = str1.concat(str2);S ystem.out.println(str3);}}程序的运行结果是A)abcB)ABCC)abcABCD)ABCabc

考题 classBeta{publicstaticvoidmain(String[]args){Integerx=newInteger(6)*7;if(x!=42){System.out.print(42);}elseif(x.equals(42)){System.out.print(dot=);}else{System.out.print(done);}}}结果为:()A.42B.doneC.dot=D.编译失败

考题 publicclassTest{publicstaticvoidmain(String[]args){Stringstr=NULL;System.out.println(str);}}Whatistheresult?() A.NULLB.Compilationfails.C.Thecoderunswithnooutput.D.Anexceptionisthrownatruntime.

考题 下面代码的运行结果是( )。 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.abcB.ABCC.abcABCD.ABCabc

考题 阅读下面程序 public class ConcatTest { public static void main(String[] args) { String str1="abc"; String str2="ABC": String str3=str1.concat(str2); System.out.println(str3); } } 程序运行的结果是A.abcB.ABCC.abcABCD.ABCabc

考题 阅读下面程序 public class ConcatTest{ public static void main(String[] args) { String strl = "abc"; String str2 = "ABC"; String str3 = str1.concat(str2); System.out.println(str3); } } 程序的运行结果是:A.abeB.ABCC.abcABCD.ABCabc

考题 14、下面程序的运行结果是:() class test{ public static void main(String[] args) { String str = "hello zut"; System.out.print(str.charAt(2)); System.out.print(str.length()); System.out.print(str.substring(4)); } }A.e9ozutB.l9o zutC.l8 zutD.e8o zut

考题 以下程序段输出的结果是() public class Test{ public static void main(String[] args) { String str=”ABCDE”; str.substring(3); str.concat(“XYZ”); System.out.println(str); } }A.DEB.DEXYZC.ABCDED.CDEXYZ

考题 以下程序段输出的结果是() public class test { public static void main(String[] args) { String str = "ABCDE"; str.substring(3); str.concat("XYZ"); System.out.println(str ); } }A.DEB.DEXYZC.ABCDED.CDEXYZ