public class TwoThreadsTest { public static class SimpleThread extends Thread { public SimpleThread(String str) { super(str); } public void run() { for (int i = 0; i < 10; i++) { System.out.println(i + " " + getName()); try { sleep((long)(Math.random() * 1000)); } catch (InterruptedException e) {} } System.out.println("DONE! " + getName()); } } // end class SimpleThread public static void main (String[] args) { SimpleThread T1 = new SimpleThread("Jamaica"); T1.setPriority(Thread.MIN_PRIORITY); T1.start(); new SimpleThread("Fiji").start(); } } // end class TwoThreadsTest