The program should print a message every second, but it prints everything instantly. What’s wrong?
for (int i = 0; i < 5; i++) {
System.out.println("Tick " + i);
Thread.sleep(1000); // Error: Unhandled exception
}
The program should print a message every second, but it prints everything instantly. What’s wrong?
for (int i = 0; i < 5; i++) {
System.out.println("Tick " + i);
Thread.sleep(1000); // Error: Unhandled exception
}
To reply to a question, please log in.