I was practicing from Dan Chisholm's java tests and came across this question.
Here's my question. During the 3rd loop the variable "x" is set to 3. success is still 0. Shouldn't the loop stop since x is 3?? Any insight would in helpful...
The loop will not stop because of this statement. while ((x != 3) || (success < 2)) You are saying the loop should continue as long as one of the conditions is true. You need to use && while ((x != 3) && (success < 2));
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley