Copyright © 2001 Qusay H. Mahmoud
9
Creating and Starting Threads
lThere are two ways to create a thread in Java
–Extending the Thread class
–class MyThread extends Thread {
–     ….
–     public void run() {
–        ….
–     }
–     public static void main(String argv[]) {
–        MyThread t1 = new MyThread();
–        t1.start();
–     }
–}
–