Alright the input is a string of numbers and operators such as, + 2 3 * 4. I want to split the string up into an ArrayList object, with each character in the string getting it's own index. Here's what I have;
String current;
String s = "+ 2 3 * 4";
List <String> splitter = new ArrayList<String>(Arrays.asList(s.split("\\s+")));
current = splitter.remove(0);
if (current == "+"){
//do stuff }
else if (current = "-") {
//do stuff }
....
The if statements aren't being evaluated as true for some reason, am I missing something subtle or am I completely wrong here?
Thanks for the help.