+ 1

How do I make a countdown?

4th Jul 2016, 2:13 AM
Mustafa Can
1 Answer
0
well - not very elegant but this can be a solution: for (int i = 10; i > 0; i--){ System.out.println("seconds left:" + i); Thread.sleep(1000); } System.out.println("Loop finished successfully"); PS: don't forget the try/catch. If you work with this exception u need to catch it
4th Jul 2016, 4:55 AM
Robert