Uderc programming article aggregator sites

Is there an easy way to go back to a specific part of a program?

Tags:
Answers: Have 9 answers
Advertisement
I am writing a program and what I need is that once it has performed one action according to the users input, I need it to go back to just after the start of the program.
for example is have:
(Start of code)
menu
-if
--if
--else
-else if
--if
---for
--else
(rest of code)what i need is once it has done either one of the (*) for it to go back to the menu
However I am not sure how to do this. The only way I know of going back is with while loops but I dont think (?) this would work here.
I hope you understand this, trying not to paste my whole code in here but will do if people dont underatand what i mean!
Advertisement
The best answer: Thanks for the tip.
I had never used the continue statement before so looked it up. Tried it and it half worked but tried other things mentioned on the same page and using break; got it to do what I was after!
thankyou all for your help and leading me in the right direction. (please don't tell my tutor im up at almost 4am still doing my java work, and not becuase it has to be in soon, becuase worryingly im rather enjoying it)
lol.