Created an ArrayList and filled its slots:
ArrayList<String> tempTable = new ArrayList<String>();
tempTable.add("1");
tempTable.add("12");
tempTable.add("2");
tempTable.add("11");
tempTable.add("5");
Now, I'd like to replace some of values, so created conditions:
for (int i = 0; i < tempTable.size(); i++)
{
if (tempTable.get(i) == "11")
{
tempTable.set(i, "1st FBS");
}
else if (tempTable.get(i) == "12")
{
tempTable.set(i, "2nd FBS");
}
else if (tempTable.get(i) == "13")
{
tempTable.set(i, "3rd FBS");
}
else
{
// leave as is
}
}
When I run it, I get the original values untouched, so it prints 1, 12, 2, 11, 5 instead of having 11 and 12 replaced. Made a test with ArrayList and it worked, but in this case I can't get it working as I wish.
Any hints what could be wrong in my code?