I would do something similar to Tim's answer. But in order to do what you tried to do, you have many problems that need to be addressed:
(1) String literals in Java are surrounded by double quotes, not single quotes.
(2) user_input
Scanner
. . String
String
. , answerString
, user_input
.
(3) ==
. StackOverflow 953 235 Java, 826 102 , - ==
. (, .) equals
: string1.equals(string2)
.
(4) do-while
, do
, {
, , }
, while(condition);
. , }
. }
while
else
, ; }
while
, .
(5) , , , yes
no
. : , , yes
no
. while
:
while (!(answerString.equals("yes") || answerString.equals("no")));
[ , equalsIgnoreCase
, .] !
"" , , !
, !
. , "Loop blah-blah-blah", "Loop while
!
(blah-blah-blah)".