谢谢

解决方案 »

  1.   

    @exception  InterruptedException if any thread has interrupted
         *             the current thread.  The <i>interrupted status</i> of the
         *             current thread is cleared when this exception is thrown.
      

  2.   

    sleep
    public static void sleep(long millis)
                      throws InterruptedException在指定的毫秒数内让当前正在执行的线程休眠(暂停执行)。该线程不丢失任何监视器的所属权。 参数:
    millis - 以毫秒为单位的休眠时间。 
    抛出: 
    InterruptedException - 如果另一个线程中断了当前线程。当抛出该异常时,当前线程的中断状态 被清除。
    --------------------------------------------------------------------------------sleep
    public static void sleep(long millis,
                             int nanos)
                      throws InterruptedException在指定的毫秒数加指定的纳秒数内让当前正在执行的线程休眠(暂停执行)。该线程不丢失任何监视器的所属权。 参数:
    millis - 以毫秒为单位的休眠时间。
    nanos - 要休眠的另外 0-999999 纳秒。 
    抛出: 
    IllegalArgumentException - 如果 millis 值为负或 nanos 值不在 0-999999 范围内。 
    InterruptedException - 如果另一个线程中断了当前线程。当抛出该异常时,当前线程的中断状态 被清除。