返回列表 發帖
  1. public class Ch121
  2. {
  3.         public static void main(String args[])
  4.         {
  5.                 for(int i=5;i>=1;i--)
  6.                 {
  7.                         System.out.println(i+"秒");
  8.                         try {
  9.                                 Thread.sleep(1000);
  10.                         } catch (Exception e) {        }
  11.                 }
  12.                 System.out.println("時間到");
  13.                 System.out.println("執行緒名稱:"+Thread.currentThread().getName());
  14.         }
  15. }
複製代碼

TOP

返回列表