public class TestSrot implements Runnable { private int number; public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public TestSrot(int number) { super(); this.number = number; } @Override public void run() { // TODO Auto-generated method stub try { Thread.sleep(this.number); System.out.println(this.number); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) { int[] numbers = {10,2,5,12,1,50}; for(int num : numbers) { new Thread(new TestSrot(num)).start(); } } }