Java program to extends the Thread class
KW.java
class KW extends Thread
{  
    public void run()
    {  
        System.out.println("Thread Running...");  
    }  
    public static void main(String args[])
    {  
        KW k=new KW();  
        k.start();  
    }  
}
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Thread Running... kodingwindow@kw:~$
Advertisement