返回列表 發帖
  1. public class Ch998 {
  2.       
  3.         public static void main(String[] args) {
  4.                 for(int i=5; i>=1; i--)
  5.                 {
  6.                         System.out.println(i+"sec");
  7.                         try {
  8.                                 Thread.sleep(1000);
  9.                         } catch (InterruptedException e) {}
  10.                 }
  11.                 System.out.println("times up");
  12.                 System.out.println("name: "+Thread.currentThread().getName());
  13.         }
  14. }
複製代碼

TOP

返回列表