已知String s1 = "ABCD1234";String s2 = new String("ABCD1234");下面结果为true 的是:
A: s1==s2;
B: s1==s2.intern();
C: s1.compareTo(s2);
D: s1.isEmpty();
A: s1==s2;
B: s1==s2.intern();
C: s1.compareTo(s2);
D: s1.isEmpty();
举一反三
- 以下程序的输出结果是 String s1="1",s2="2"; String s=s1+s2; System.out.println(s);
- 已知String s1 = "ABCD1234"; String s2="abcd1234"; 下面结果为true的是 A: s1==s2; B: s1.equals(s2); C: s1. equalsIgnoreCase (s2); D: s1.compareTo(s2);
- 设s="abcd",s1="123",则执行语句s2=InsStr(s,2,s1)后,s2=()
- 请说出下列代码的执行结果 : String s = "abcd"; String s1 = new String(s); if (s = = s1) System.out.println("the same"); if (s.equals(s1)) System.out.println("equals");
- 设s="abcd" ,s1="123" ,则执行语句s2=InsStr(s,2,s1)后,s2= A: "123abcd" B: "a123bcd" C: "ab123cd" D: "abc123d"