农业经济高级经济师:请看看这个程序怎么编译不能通过

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/16 19:04:53
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();}
}