@@ -0,0 +1,815 @@
+// http://www.nakov.com/books/inetjava/%0A%0A// page 29%0A%0Aclass MyThread extends Thread %7B%0A%09private String name;%0A%09private long timeInterval;%0A%09%0A%09public MyThread(String name, long timeInterval) %7B%0A%09%09this.name = name;%0A%09%09this.timeInterval = timeInterval;%0A%09%7D%0A%09%0A%09@Override%0A%09public void run() %7B%0A%09%09try %7B%0A%09%09%09while (!isInterrupted()) %7B%0A%09%09%09%09System.out.println(this.name);%0A%09%09%09%09sleep(this.timeInterval);%0A%09%09%09%7D%0A%09%09%7D catch (InterruptedException intEx) %7B%0A%09%09%09// Current thread was interrupted by another thread%0A%09%09%7D%0A%09%7D%0A%7D%0A%0Apublic class ThreadTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09MyThread firstThread = new MyThread(%22Thread 1%22, 1000);%0A%09%09MyThread secondThread = new MyThread(%22Thread 2%22, 3000);%0A%09%09MyThread thirdThread = new MyThread(%22Thread 3%22, 1500);%0A%09%09%0A%09%09firstThread.start();%0A%09%09secondThread.start();%0A%09%09thirdThread.start();%0A%09%7D%0A%0A%7D%0A

Create ThreadTest.java