0
Someone knows how I check a word in an if-statement?
I'm trying to get user input and check in an if-statement. My input is a string (a) and it must have 'yes' stored. I tried 'if (a.next() == "yes") {' but it always goes directly to the 'else' part. (the code of the scanner is 'Scanner a = new Scanner(System.in);' . Can somebody help me?
5 ответов
+ 3
Donna i think they are asking if the whole string includes ‘yes’...
+ 2
Can you show us your code?
0
thank you guys for helping. It worked verry well ;)