How to repeat/loop/return to a class

前端 未结 4 1008
独厮守ぢ
独厮守ぢ 2021-01-28 02:22

Im a beginner with java and i am following tutorials by Thenewboston on youtube. I wanted to go to a bit more advanced (in my opinion... but not really) things. So heres the c

4条回答
  •  一整个雨季
    2021-01-28 03:01

    like in C or C++ you could use a while statement , askin after the execution is the user want go to exit or not

    while (answer){
      // ...code...
    }
    

    also you could use do..while

    do{
      // ...code...
    }while(condition)
    

提交回复
热议问题