i m students
i hope i will get here guidance frm experts.
Printable View
i m students
i hope i will get here guidance frm experts.
sme error in dis programme
class NewThread extends Thread
{
NewThread()
{
super("demo thread:");
System.out.println("child Thread:"+this);
start();
}
public void van()
{
try
{
for(int i=5;i>0;i--)
{
System.out.println("child Thread:"+i);
Thread.sleep(500);
}
}
catch(InterruptedException e)
{
System.out.println("child Thread");
}
System.out.println("exiting child");
}
}
Hello ashwinp.
Welcome to the forums.
Please post your Java problems in the correct forum with a descriptive title. It will help get answers quicker. Thanks.
Code Java:class NewThread extends Thread1 { NewThread() { super("demo thread:"); System.out.println("child Thread:"+this); start(); } public void van() { try { for(int i=5;i>0;i--) { System.out.println("child Thread:"+i); Thread.sleep(500); } } catch(InterruptedException e) { System.out.println("child Thread"); } System.out.println("exiting child"); } } class Three { public static void main(String str[]) { new Thread(); try { for (int i=5;i>0;i--) { System.out.println("main Thread:"+i); Thread.sleep(1000); } } catch(interruptedException e) { System.out.println("main Thread......"); } System.out.println("exiting Thread"); } }