Is there a command in java to make the program go back to the beginning of a loop

后端 未结 5 767
独厮守ぢ
独厮守ぢ 2021-01-22 12:22

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         


        
5条回答
  •  隐瞒了意图╮
    2021-01-22 12:22

    Less detailed and more straight to the point. I have over explained simple answers.

    for(int i = 0; i <= 10; i++){
            if(i == 4){
                continue;
            }
            //Should skip 4 and print out 1,2,3,5,6,7,8,9,10
            System.out.println(i);
        }
    

提交回复
热议问题