21CT Interview Question

How do you create another thread in Java?

Interview Answer

Anonymous

Dec 5, 2013

implementation create 1. create a class1 that implements Runnable Must include method public void run() {} create 2. create a class2 that extends Thread start 1. (new Thread(new class1())).start(); start 2. (new class2()).start();