Lost in strings.equals
I'm somewhat confused with the behaviour of the code I've written that's located here(new win).
At this line
if( !response.equals("215") ); {
response is obviously checked for being equal to "215". Problem is, even if you enter "215", it somehow sees it as something else and executes IncorrectResponse();.
Can anyone explain to me why this is happening and how I could avoid it?
Thanks,
Val.
At this line
if( !response.equals("215") ); {
response is obviously checked for being equal to "215". Problem is, even if you enter "215", it somehow sees it as something else and executes IncorrectResponse();.
Can anyone explain to me why this is happening and how I could avoid it?
Thanks,
Val.
