A.abc
B.123
C.a1b2c3
D.a1b2c3
E.Compilationfails.
F.Thecoderunswithnooutput.
G.Anexceptionisthrownatruntime.
第1题:
A.Anexceptionisthrownatruntime.
B.1
C.4
D.Compilationfails.
E.0
第2题:
A.abc
B.123
C.a1b2c3
D.a1b2c3
第3题:
写出以下程序的运行结果? public class Test{ public static void main(String argv[]){ String s = new String("hello"); myMethod(s); System.out.print("s=" + s); } public static void myMethod(String s){ s = s + "!"; } }
A.s=hello!
B.s=hello
C.hello!
D.hello
第4题:
A.0
B.1
C.4
D.Compilationfails.
第5题:
1、写出以下程序的运行结果? public class Test{ public static void main(String argv[]){ String s = new String("hello"); myMethod(s); System.out.print("s=" + s); } public static void myMethod(String s){ s = s + "!"; } }
A.s=hello!
B.s=hello
C.hello!
D.hello