ale*_*308 -2 java
我运行了以下代码:
String s1 = "Hello"; if(s1.equals(s1.concat(" World"))) System.out.println("true"); else System.out.println("false");
输出是"假".为什么s1不等于自己?
wer*_*ero 5
s1 等于自己.
s1
s1.concat(" World")不修改s1但返回一个不等于的新String对象s1.
s1.concat(" World")
归档时间:
10 年,4 月 前
查看次数:
77 次
最近记录: