public class TwoThreadsTest {
    public static void main (String[] args) throws Exception{
        new SimpleThread("Jamaica").start();
        new SimpleThread("Fiji").start();
    
        System.out.println("<enter> to exit");
        System.in.read();
    } 
}

class SimpleThread extends Thread {
    public SimpleThread(String name) {
        super(name);
    }
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(i+" "+getName());
            try {
                sleep((long)(Math.random() * 1000));
            } catch (InterruptedException ex) {}
        }
        System.out.println("DONE! " + getName());
    }
}

/*
*/
