This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Looping correctly" Watch "Looping correctly" New topic

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

Joined: Oct 02, 2003
Posts: 11855

how about wrapping most of your code in a

} 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
Have you checked out Aspose?
subject: Looping correctly
It's not a secret anymore!