Extending the Thread class
i would like to do that
1) One thread displays "ABC" every 2 second;
2) The other thread displays DEF every 5 seconds;
i need to create the threads by extending the Thread class ...
thank you for your help ,
publicclass Thread1extends Thread{
public Thread1(String s ){
super (s);
}
publicvoid run(){
for (int i=0; i<5; i++ ){
System.out.println(getName());
try{
sleep ((long) 5000);
}catch (InterruptedException e ){
/* do nothing */
}
}
}
publicstaticvoid main (String args[]){
new Thread1 ("ABC").start();
new Thread1 ("DEF").start();
}
}

