//inherits Thread class
//performing single task using single thread
public class CreateThread extends Thread {
@Override
public void run() {
System.out.println("Thread Task");
}
public static void main(String[] args) {
//Creating object of class CreateThread
CreateThread c1 = new CreateThread();
//invoking thread using start method;
c1.start();
//gives exception, we can not start a thread twice
c1.start();
}
}