這段代碼為什麼輸出結果是那樣的,難道java不是一步步往下執行嗎?
public class Test {
public static void main(String[] args) {
String a = "hello2";
final String b = "hello";
String d = "hello";
String c = b + 2;
String e = d + 2;
System.out.println((a == c));
System.out.println((a == e));
}
}
true
false
http://bbs.csdn.net/topics/391070616