Skip to content
Sign upLog in

How to repeat the program without running it

Profile icon
huntercanttell

I was looking around but there isn't very much solid information for JAVA, I am trying to create a scanner question that asks if the user wants to restart the program, like "would you like to restart? Yes/No" kinda thing, does anyone have an idea or code that I can learn from? I want the program to run lines from ex. 3-50. I don't want the code to go ex. 1,2,3,4,5,6 etc. If the user says yes the program will re-run itself and all the scanners in between

You are viewing a single comment. View All
Profile icon
Coder100

Yes called while loops

while (true) { if (... condition to break...) break; }