
// use Runnable interface instread
class MyRunnable implements Runnable {

	@Override
	public void run() {
		System.out.println("Thread is running... " + Thread.currentThread().getName());
	}

}

public class TestRunnable {

	public static void main(String[] args) {
		// create runnable object
		MyRunnable r1 = new MyRunnable();
		Thread t1 = new Thread(r1, "T1");
		Thread t2 = new Thread(r1, "T2");
		Thread t3 = new Thread(r1, "T3");

		// start the threads
		t1.start();
		t2.start();
		t3.start();
	}

}
