I am attempting to read from a file in Java, and use the string I get as a condition in an if
statement. I know the reader is correct (it works in other programs), but when I try to do something like
if(reader.getVariable() == "A") {
do x
}
else {
do y
}
It will always do y, even though printing out the getVariable()
method returns "A". Why is this?