how can i loop a whole code and make it repeat until the user wants to stop.
javaman2
-5
Junior Poster in Training
Recommended Answers
Jump to Postboolean stop = false; while (!stop) { //code to be repeated //ask user if he/she wants to stop if yes stop = true; }
Jump to PostThis forum is full of examples on how to read input from the keyboard.
Do a little search.Also check the classes:
Scanner
BufferedReader
All 5 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
javaman2
-5
Junior Poster in Training
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
javaman2
-5
Junior Poster in Training
stephen84s
commented:
Still no code tags
-1
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.