Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Looping correctly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Looping correctly" Watch "Looping correctly" New topic
Author

Looping correctly

Sean Magee
Ranch Hand

Joined: Aug 23, 2004
Posts: 69
What is the best way tp loop it back to the user, for example in this code





But i couldnt figure out how, if the user clicked "yes" option, to return it back to the beginning to do it over again.

Could anyone help me here?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11250
    
  16

how about wrapping most of your code in a

do
{
} while (something is true)
[ September 10, 2004: Message edited by: fred rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looping correctly