class Test{
public static void main(String s[]){
String s1="welcome",s2="come";
System.out.println(s1==("wel"+"come")); //prints : true
System.out.println(s1==("wel"+s2)); //prints : false
}
}
我想知道为什么两个println方法都给出不同的结果。 请详细解释。关于java结果的困惑字符串
看看这个主题:http://stackoverflow.com/q/2772763/155137 –