/* This is my first threaded program in Java */ public class Test { static final int NUM_THREADS = 10; public static void main(String[] argv){ for (int i=0; i < NUM_THREADS; i++) createThread(i); } public static void createThread(int i){ MyThread t = new MyThread(new Integer(i).toString()); t.start(); } } class MyThread extends Thread{ static final int NUM_PRINTS = 3; MyThread(String s){ super(s); } public void run(){ for (int i=0; i < NUM_PRINTS; i++){ System.out.println(getName()); } } }