なぜ間違った出力を出力するのですか?
ArrayList<String> loc = new ArrayList<String>();
この配列リストには、次の値が格納されています。
[topLeft, topLeft, topLeft, bottomLeft, topLeft, bottomLeft, topLeft, topLeft, Left, topLeft]
最初のインデックス0は=topLeft
if(loc.get(1)=="topLeft")
System.out.println("same")
else {
System.out.println("not same")
}
not same
このプログラムは、代わりに間違った出力を出力しますsame