String str = "HelloWorld!";System.out.print(str.subString(5,10));
A: oWorl
B: oWorld
C: World
D: World!
A: oWorl
B: oWorld
C: World
D: World!
举一反三
- String str = "HelloWorld!";System.out.print(str.subString(5,10)); A: oWorl B: oWorld C: World D: World!
- world = "world"str = 'hello'print str+world 的结果为 A: helloworld B: hello world C: hello "world" D: 语法错误
- 有如下代码:public class Test{ public static void main(String args[]) { String str = new String("World"); char ch[] = {'H','e','l','l','o'}; change(str,ch); System.out.println(str + "and" + ch); } public static void change(String str, char ch[]) { str = "Changed"; ch[0] = ' C'; }}运行后输出的结果是: A: Changed and Cello B: World and Cello C: World and CelloChanged and Hello D: World and Hello
- world = "world"str = 'hello'print str+world 的结果为 A: helloworld B: hello world C: hello "world" D: 语法错误
- 运行print(“\”hello world\)将输出() A: helloworld B: hello world" C: "hello world D: hello world