2 Answers
+ 5
I am sorry for removing my comment because the code has many error which I didn't see before. 1. Inside if use == which compares not = because = is assignment operator and it will always be true. 2. Use double quotes for String and single for a single character. 3. When you have a string entered in the scanner use .next() 4. Therefore, change the if and else if statement to if(myVar.next() == "quit") I hope this helps.
1st Feb 2018, 7:25 PM
Samay Sharma
+ 1
Thanks
2nd Feb 2018, 1:55 PM
Abel
Abel - avatar