class Parallel implements Runnable {
  private int id;
  public Parallel(int i) {
    id = i;
    Thread t = new Thread(this);
    t.start();
  }

  public void run() {
   for (int j = 0; j < 5; j++) {
    System.out.println("My id is " + id);
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {} 
   }
  }
}

public class TestParallel2 {
  public static void main(String[] args) {
    for (int i = 0; i < 5; i++) {
      new Parallel(i);
    }
  }
}



