The code:
airCon = yes.equals("yes");
The Strings that were read:
yes=Yes<
yes=Yes<
Notice the difference of case in the spelling: Y is not equal to y
The String class has a method for...
Type: Posts; User: Norm
The code:
airCon = yes.equals("yes");
The Strings that were read:
yes=Yes<
yes=Yes<
Notice the difference of case in the spelling: Y is not equal to y
The String class has a method for...
Can you copy and paste here what is printed out?
Does that code work? What is printed out?
Change the println to:
System.out.println("yes="+yes +"<");
to see what was read and tested.
Did it work as you wanted?
Please post the current version of the code.
Are you using the code shown in post#1 to set the boolean?
Read the String into a variable and print out the value of that variable to be sure that it contains the String that you think it should.
What happens when you compile and execute the code?
What happens when you compile and execute the code?
Please edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.