A: Hello, Bob. How's everything? B: That's all right.()
第1题:
下列的哪个程序段可能导致错误?
A.String s = "hello"; String t = "good"; String k = s + t;
B.String s = "hello"; String t; t = s[3] + "one";
C.String s = " hello "; String standard = s.toUpperCase( );
D.String s = "hello"; String t = s + "good";
第2题:
写出以下程序的运行结果? 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
第3题:
下列定义的字符串,错误的是
A.s ='hello'
B.s = '''hello'''
C.s = "hello"
D.s = ""hello""
第4题:
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
第5题:
若字符串 s = 'hello',则语句 s.ljust(8, '.') 和 s.rjust(8) 的输出结果为____________。
A.'hello...' ' hello'
B.'...hello' ' hello'
C.'hello...' 'hello '
D.'hello...' 'hello'
第6题:
下列程序执行后的输出结果是 。 void main() { printf(“'s1=%7s'”,"hello"); }
A.s1=”hello”
B.s1=7hello
C.'s1= hello'
D.’s1=”hello”’