下列程序段: String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); 的结果为
A: false
B: true
C: 1
D: 0
A: false
B: true
C: 1
D: 0
举一反三
- 下列语句输出结果为( )。public class test{public static void main(String args []){String s1=new String("How");String s2=new String("How");System.out. println(!(s1 ==s2));} A: false B: true C: 1 D: 0
- 以下程序的输出结果是 String s1="1",s2="2"; String s=s1+s2; System.out.println(s);
- 写出程序段输出结果:String s1=new String("abc");String s2="abc";System.out.print((s1==s2)+",");System.out.println(s1.equals(s2)); A: false,false B: false,true C: true,true D: true,false
- 下列输出结果为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"));
- 请阅读下面的代码 String s1=new String(“abc”); String s2=sintern(); String s3=”abc”; System.out.println(s1==s2); System.out.println(s2==s3); System.out.println(s1==s3); 下列选项中,程序的输出结果为(): false true false|false false false|false false true|false true true