Skip to content
Is there anyway to delay code in java on here?
Profile icon

I’m trying to make something in java and I don’t know how to delay it.

You are viewing a single comment. View All
Answered by PDales [earned 5 cycles]
View Answer
Profile icon

You can use sleep the thread, which delays code.

it's in milliseconds, however.

Profile icon

I can’t get it to work.. this is the code I have
class DataBase implements Runnable {
Thread t;
static void main(String User){
System.out.println("Welcome " + User);
while (User == "Kris79"){
System.out.println("0 0");
It keeps saying that the class part has a error