5 以下哪些表达式返回值为真() String a=”lanqiao”; String b=”lanqiao”; String c=new String(“lanqiao”); String c=new String(a);
A: a==
B: a==c
C: c==
D: a.equals(b)
E: a.equals(c)
F: c.equals(d)
A: a==
B: a==c
C: c==
D: a.equals(b)
E: a.equals(c)
F: c.equals(d)
举一反三
- 下列值不为true的表达式为()。 A: “abc”==”abc” B: “abc”.equals(“abc”) C: “abc”.equals(new String(“abc”)) D: “abcd”=”abcd”
- 下列值不为true的表达式有( ) A: "true" !="false" B: "true".equals("true") C: "true"="true" D: "true".equals(new String("true"))
- 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 = "abcd"; String s1 = new String(s); if (s = = s1) System.out.println("the same"); if (s.equals(s1)) System.out.println("equals");