“java jeda 1 detik” Kode Jawaban

java jeda 1 detik

//deprecated in main thread:
try {
  Thread.sleep(1000);//time is in ms (1000 ms = 1 second)
} catch (InterruptedException e) {e.printStackTrace();}

//please use bellow instead:
Timer timer = new Timer();
timer.schedule(new TimerTask() {
  @Override
  public void run() {
    //what you want to do
  }
}, 1000);//wait 1000ms before doing the action
YaKiCode

Java Delay

Syntax :
=========================================================
	Thread.sleep(1000); // 1000 milliseconds..          |
=========================================================
int i=0;
for(;;){
	Thread.sleep(2000); // set time delay to 2 seconds.. 
  	System.out.println(i++); // output : every output will display after 2 seconds..   	
}
dr3am_warri0r

Jawaban yang mirip dengan “java jeda 1 detik”

Pertanyaan yang mirip dengan “java jeda 1 detik”

Lebih banyak jawaban terkait untuk “java jeda 1 detik” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya