I am trying to make a typing adventure kind of game in java, however i need a command at least similar to the one in the title, here is the code
import java.util
You can use the continue
statement to continue to the next iteration.
That said, I don't see a loop in your sample code. You can loop with a for
, while
or do/while
. The do/while loop executes at least once -- which is typically what you want to do when asking the user a question.
This Java tutorial for Branching Statements provides this example of a continue
statement in a for
loop.
for (int i = 0; i < max; i++) {
// interested only in p's
if (searchMe.charAt(i) != 'p')
continue;
// process p's
numPs++;
}