public class Test { public static void main(String[] args) { String s1 = "abc"; String s2 = new String ("abc"); System.out.println(s1 == s2); } } 程序运行结果是
举一反三
- 中国大学MOOC: 运行以下代码:public class StringRef{public static void main(String[] args){ String s1=”abc”; String s2=”def”; String s3=s2; s2=”ghi”; System.out.println(s1+s2+s3);}}运行结果是( )。
- 下列语句输出结果为( )。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
- 下面哪个结果是正确的?() public class Testjava{ public static void main(String[] args){ String s= "abcd"; String s1,s2; s1 =s.concat("e"); s2 = s1.replace('c','e'); System.out.println(s2); } } A: Abcde B: Abced C: Abede D: Abc
- public static void main(String[] args) { String s1="123"; String s2 = "123"; System.out.println(s1==s2); } 输出的结果是________
- 写出下面程序的运行结果 【15】 import java.io.*; public class abc public static void main(String args[]) String s1="Hello!"; String s2=new String("World!"); System.out.println(s1.concat(s2));