Lua Scripting Learner :
I have a block of code and I'm trying to make it so it counts down from 10, and prints it after 1 second, but nothing in the while loop will work. Any suggestions? (No errors or tips are popping up in Eclipse IDE)
public static void main(String[] args) {
int timer = 10;
while (timer>10) {
System.out.println(timer);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
timer = timer - 1;
}
System.out.println("Blast Off!");
}
MT756 :
You set timer to 10, meaning that the program inside while (timer>10)
will never gets executed.
I think you want while (timer > 0)
instead