Hello...
I'm having troubles comparing strings in an if statement...
I have a file that I have read (line by line) and then tokenized with StringTokenizer.
Now, the second token of every line is either the letter P or S (a sales spreadsheet, P stands for produced, and S for sales).
But, when I take the token and assign it to a
String variable I cannot compare it to a P or S in an If statement.
transtype = str.nextToken();
if (transtype == "P"){...
Now... I know that token is A)a string, and B)the letter P (capitalized, if it matters).
However, when the program runs it completely ignores the If statement, as if the if failed.
Why can't I compare them...
Thanks for any help!
-Andrew