How can I make a java program wait X seconds without usingThread.sleep?
public class newClass{
public static void main(String[] args){
for(int i = 0; i < 10; i++){
//Wait X second
System.out.println("Hello");
}
}
}
Thanks for any help!!
I need the program won't freeze while it's counting
wait()to benotifiedby whom?sleepdoes. So what is your issue?