+ 1
How do I make a countdown?
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