java program for threads by extending thread class

 class A extends Thread

{

public void run()

{

System.out.println("Hello");

}

}

class Demo

{

public static void main(String ar[])

{

System.out.println("One");

A ob = new A();

ob.start();

System.out.println("Two");

}

}


OUTPUT




Comments