爲什麼它打印錯誤的輸出?閱讀ArrayList元素
ArrayList<String> loc = new ArrayList<String>();
此ArrayList存儲的值:
[topLeft, topLeft, topLeft, bottomLeft, topLeft, bottomLeft, topLeft, topLeft, Left, topLeft]
冷杉索引0是=左上
if(loc.get(1)=="topLeft")
System.out.println("same")
else {
System.out.println("not same")
}
此程序的打印錯誤的輸出的not same
代替same
非常感謝你...我怎麼能錯過:-) – Jessy 2010-03-28 20:33:35