- 2

How can i run this

if cond is not supporting, can't i use a string in if condition https://code.sololearn.com/cg2q7pOlTEdp/?ref=app

2nd May 2017, 6:06 PM
Abhishek
Abhishek - avatar
4 ответов
+ 23
In addition to Christian's answer, ans is your Scanner object, but the user input is know. Use: if(know.equals("yes"))
2nd May 2017, 7:03 PM
Shamima Yasmin
Shamima Yasmin - avatar
+ 1
Read up on String.equals().
2nd May 2017, 6:28 PM
Christian Bradley
Christian Bradley - avatar
0
thank you .. and I'll read up that
2nd May 2017, 7:05 PM
Abhishek
Abhishek - avatar