• λ我爱Aspx >> Asp.Net >> 小问题,要线等.
  • 小问题,要线等.

  • :aspxer  Դ:csdn  :2007-7-6 2:50:20  ؼ:
  • package com;

    google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";

    import java.util.*;

    public class Alert {

    Timer timer;

    public Alert(){

    timer=new Timer();

    timer.schedule(new RemindTask(),0,1*1000);

    }

    public static void main(String[] args) {

    // TODO Auto-generated method stub

    new Alert();

    }

    }

    package com;

    import java.util.TimerTask;

    public class RemindTask1 extends TimerTask {

    int numWarning=5;

    public void run() {

    if(numWarning==5){

    System.out.println("Alert!");

    numWarning--;

    }

    else{

    System.out.println("Time"s up!");//怎么是执行这行的?

    System.exit(0);

    }

    }

    }

    运行结果:

    Time"s up!

    怎么结果不是这个:

    Alert!

    Alert!

    Alert!

    Ҷƪл˵?
  • һƪ有关final 类的一个简单问题
    һƪ如何安装Windows XP系统