Java examples for Thread:Thread Operation
Pause Thread Using Sleep Method
public class Main { public static void main(String[] args) { try{ /*from www . j a v a 2 s .c o m*/ for(int i=0; i< 5; i++){ System.out.println(i); Thread.sleep(1000); } } catch(InterruptedException ie){ System.out.println("Thread interrupted !" + ie); } } }