You are here:   HomeJava ProgrammingMultithreadingSleep Method in Thread in Java Example
by Dinesh Thakur Category: Multithreading

 

class JavaExampleSleepMethodInThread

 {
    public static void main(String as[])
    {
     try 
        {
            System.out.println("Welcome");
            Thread.sleep(1500);
            System.out.println("To");
            Thread.sleep(1500);
            System.out.println("Java");
            Thread.sleep(1500);
        }
            catch(InterruptedException e1) {}
    }
 }
Sleep Method in Thread in Java Example