Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package demo1;
  2. class Runner extends Thread
  3. {
  4.     public void run()
  5.     {
  6.         for ( int i = 0; i<10; i++)
  7.         {
  8.             System.out.println("Hello " + i);
  9.             try {
  10.                 Thread.sleep(100);
  11.             } catch (InterruptedException e) {
  12.                 e.printStackTrace();
  13.             }
  14.         }
  15.     }
  16. }
  17. public class App
  18. {    
  19.     public static void main(String[] args)
  20.     {
  21.         Runner runner1 = new Runner();
  22.         runner1.start();
  23.         Runner runner2 = new Runner();
  24.         runner2.start();
  25.     }
  26. }