String s1="hdczyj";String s2="HDCzyj";System.out.println(s1.equalsIgnoreCase(s2));在控制台输出
举一反三
- 以下程序的输出结果是 String s1="1",s2="2"; String s=s1+s2; System.out.println(s);
- 以下要输出“hello,world!”正确的是? A: String s=String.format("%1s%2s","hello","world");System.out.println(s); B: String s=String.format("%1$s,%2$s","hello","world");System.out.println(s); C: String s=String.format("%s,%s","hello","world");System.out.println(s); D: String s=String.format("%1s,%2s","hello","world");System.out.println(s);
- 请说出下列代码的执行结果 : 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和s2的值分别是什么?string s;int main(){string s2;
- 下列输出结果为false的是( ) String s1 = new String("SUN"); String s2 = new String("SUN"); A: System.out.println(s1 == s2); B: System.out.println(s1.equals(s2)); C: System.out.println(s1 = s2); D: System.out.println(s1.equals("SUN"));