• 2022-05-29
    6、下列程序的运行结果是()。String s1 = new String( "abc" );String s2 = new String( "abc" );System.out.println( s1 == s2);String s3 = "你好吗?" ;String s4 = "你" ;String s5 = "好吗?" ;System.out.println( "你好吗?" ==("你" + "好吗?"));
    A: true true
    B: false false
    C: false true
    D: true false
  • C

    内容

    • 0

      若有String s1 ="abc" ; String s2 = "abc" ; 则s1 == s2;和s1.equals(s2) 的结果分别是( ) A: true , true B: true , false C: false, true D: false , false

    • 1

      以下程序的输出结果是 String s1="1",s2="2"; String s=s1+s2; System.out.println(s);

    • 2

      下列语句输出结果为( )。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

    • 3

      下列代码片段执行结果是:String s=new String(”abc”); String s1=new String(s); if(s==s1){ System.out.println(”Hello”); } if(s.equals(s1)){ System.out.println(”World”); } A: Hello World B: Hello C: World D: Null

    • 4

      若String s1="abc"; String s2="abc",则s1==s2的值为() A: true B: false