How can I delay something in Java?
I want something to delay in Java, but I don't know how....
Thanks!
Voters
cuber1515
I believe you do Thread.sleep()
and in the parenthesis put the milliseconds, so if you wanted to do it for 1 second, then: Thread.sleep(1000)
.
Use the thread.sleep method.
https://www.tutorialspoint.com/java/lang/thread_sleep_millis.htm
@Coder100 It says "Unhandled exception type InterruptedExecption" when I did the stuff.
@PythoNinja send repl that's not supposed to happen
@Coder100 Now it says this instead:

@PythoNinja
change that line to that
@Coder100 Okay, I changed my Main Class into the public class main, and now, it says

for some reason.
uh can you invite me you did it wrong @PythoNinja
@Coder100 alright