给定如下Java代码,编译运行时,以下()语句的值是true。
Strings=”hello”;
Stringt=”hello”;
Stringe=newString(”hello”);
charc[]={‘h’,e’,’l’,’l’,o’};
Strings=”hello”;
Stringt=”hello”;
Stringe=newString(”hello”);
charc[]={‘h’,e’,’l’,’l’,o’};
举一反三
- String s=”hello”;String t=”hello”;String e=new String(”hello”) ;char c[]={„h‟,e‟,‟l‟,‟l‟,o‟};给定如上Java代码,编译运行时,以下( )语句的值是true。 A: s.equals(t) B: t.equals(c) C: t== e D: t==c
- 给定如下java代码,编译运行时,以下()语句的值是trueString s="hello";String t="hello";String e=new String("hello");char c[]={"h","e","l","l","0"}; A: s.equals(t); B: t.equals(c); C: t.equals(e); D: t==c
- 以下代码的输出是() str3 = 'Hello World!' print(str3.split()) A: ['Hello', 'World!'] B: ['Hello', 'World','!'] C: ['H','e','l','l','o',' ','W','o','r','l','d','!'] D: ['H','e','l','l','o','','W','o','r','l','d','!']
- (4-1)Java语言中,正确的初始化语句是()。 A: charstr[]="hello"; B: charstr[100]="hello"; C: charstr[]={'h','e','l','l','o'}; D: charstr[]={'hello'};
- Java语言中,正确的初始化语句是()。 A: charstr[]="hello"; B: char str[]={'h','e','l','l','o'}; C: charstr[100]="hello"; D: charstr[]={'hello'};