城轨管理专科学校四川:请看看这个程序怎么编译不能通过 ;到底是什么问题?谢谢!

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/14 03:22:30
class PingPong extends Thread {
private String word;
private int delay ;
public PingPong (String whatToSay,int delayTime)
{word=whatToSay;delay=delayTime;}
public void run(){
try{
for( ; ; ){
System.out.println(word+" ");
Thread.sleep(delay);
}
}catch(InterruptedException e){ return;} }
}
public static void main(String args[]){
PingPong qq= new PingPong("ping",40);//创建线程
PingPong pp= new PingPong("Pong",100);
pp.start();qq.start();//线程开始运行
}
}