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.
I am trying to figure out how to restart a program after I have already run through it. For instance, Would the user like to start over again, where should I place this code and should I use a Loop of some sort Thanks Jpre
JP Just put the entire working part of the main in a loop. Here it is in a do loop:
you'll need to declare the int variable doOver in the code above where the loop starts. One point though, from a design stand point. You're collecting the information from the user in inputDialogs but then you show the results on the command line. That is a little hard to follow and some users might get confused. It might be better to do it all one way or the other - all on the command line or all with dialog boxes. hope that helps you out ------------------ Dave Sun Certified Programmer for the Java� 2 Platform [This message has been edited by Dave Vick (edited September 10, 2001).]
Joined: Sep 10, 2001
Thanks dave that helps me out a lot, I am very new to java, and still think in terms of c, to take input from the command line from the user, How do I do that. My book dosen't go into to much detail. Thanks Jp