返回列表 發帖
  1. public class Ch123 {
  2.         
  3.         public static void main(String[] args)
  4.         {
  5.                     System.out.println("給你5秒鐘走路!!聽到沒有!!");
  6.                 for(int i=5; i>=1; i--)
  7.                 {
  8.                         System.out.println(i+"秒");
  9.                         try {
  10.                                 Thread.sleep(1000);
  11.                         } catch (InterruptedException e) {}
  12.                 }
  13.                 System.out.println("時間到了~還不快滾!");
  14.                 System.out.println("執行緒名稱: "+Thread.currentThread().getName());
  15.         }
  16. }
複製代碼

TOP

返回列表