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

class SimpleRunnable implements Runnable {
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(i+" "+Thread.currentThread().getName());
            
            try {
                Thread.sleep((long)(Math.random() * 1000));
            } catch (InterruptedException e) {}
        }
        
        System.out.println("DONE! " + Thread.currentThread().getName());
    }
}
