Answers for "wait and sleep method in java"

7

java sleep in code

import java.util.concurrent.TimeUnit

TimeUnit.SECONDS.sleep(1);
or
TimeUnit.MINUTES.sleep(1);
Posted by: Guest on June-19-2020
4

sleep() java

import java.util.concurrent.TimeUnit

try {
	TimeUnit.SECONDS.sleep(1);
}
catch (Exception e) {
	System.out.println("Oops! Something went wrong!")
}
Posted by: Guest on September-02-2020
2

wait method in java

java.lang.Object.wait() causes current thread to wait until another thread 
invokes the notify() method or the notifyAll() method for this object.
Posted by: Guest on July-09-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language