class A extends Thread {
public void run() {
int i;
for(i=1;i<=10;i++)
{
System.out.print(i);
try
{
sleep(1000);
}
catch(Exception e){}
}
}
}
class B extends Thread {
public void run() {
int i;
for(i=65;i<=74;i++)
{
System.out.print((char)i);
try
{
sleep(1000);
}
catch(Exception e){}
}
}
}
class Multithread {
public static void
main(String args[]) {
A t1=new
A();
B t2=new B
();
t1.start();
t2.start();
}
}
Ye program run kiya tha. Tumne to thread ka object hi nhi create kiya
ReplyDelete