String s=new String(“hello”); String t =new String(“hello”); char c [ ] ={‘h’,’e’,’l’,’l’,’o’}; 下列哪些表达式返回true ?
举一反三
- String s=new String(“hello”);String t =new String(“hello”);char c [ ] ={‘h’,’e’,’l’,’l’,’o’};下列哪些表达式返回true ? A: s.equals(t); B: t.equals(c); C: s= =t ; D: t.equals (new String(“hello”));
- 给出下面的代码String s= "hello";String t = "hello";char c[] = {'h','e','l','l','o'};下列选项里,哪些返回true? [] A: s.equals(t); B: t.equals(c); C: s==t; D: t.equals(new String("hello")); E: t==c;
- String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?() A: s.equals(t); B: t.equals(c); C: s==t; D: t.equals(new String("hello")); E: t==c;
- 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
- 59 给定以下代码,哪些语句的结果不为 true String s1 = “hello” ; String s2 = “hello” ; String s3 = new String(“hello”) ; char[] c = {‘h’,’e’,’l’,’l’,’o’}; String s4 = new String(c); A: s1.equals(s2) B: s3.equals(s4) C: s1==s2 D: s3==s4