- String s1 = “abc”;
- String s2 = new String(“abc”);
- System.out.println(s1==s2);
- String s3 = “你好吗”;
- String s4 =”你”;
- String s5 =”好吗”;
- System.out.println(s3==(s4+s5)) ;
- //上面和下面的有什么不同
- String s1 = “abc”;
- String s2 = new String(“abc”);
- System.out.println(s1==s2);
- String s3 = “你好吗”;
- String s4 =”你”;
- String s5 =”好吗”;
- System.out.println(s3==("你"+"好吗"));
复制代码
|
|