world = "world"str = 'hello'print str+world 的结果为
A: helloworld
B: hello world
C: hello "world"
D: 语法错误
A: helloworld
B: hello world
C: hello "world"
D: 语法错误
举一反三
- 运行print(“\”hello world\)将输出() A: helloworld B: hello world" C: "hello world D: hello world
- world = "world"str = 'hello'print str+world 的结果为 A: helloworld B: hello world C: hello "world" D: 语法错误
- 下列语句或语句序列中有语法错误的是_____。 A: int i,j; for( i=0, j=0; i<5; i++, j--)cout<<"Hello World!"; B: for(10)cout<<"Hello World!"; C: int i; for( i=0; i<5; i+=2) cout<<"Hello World!"; D: int i=0; for( ; i<5; i++) cout<<"Hello World!";
- 有如下代码: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
- String str = "HelloWorld!";System.out.print(str.subString(5,10)); A: oWorl B: oWorld C: World D: World!