返回列表 發帖

執行緒 (二)

自己建立一個新的類別,並繼承Thread 來查看執行結果
  1. package tw.kuas.edu.tw;

  2. import java.util.Date;
  3. import java.text.SimpleDateFormat;

  4. public class Main {

  5.         public static void main(String[] args) {
  6.                 // TODO 自動產生的方法 Stub
  7.                
  8.                 System.out.println("Thread 開始");
  9.                
  10.                 TimeThread thread = new TimeThread();
  11.                 thread.start();
  12.                
  13.                 System.out.println("Thread 結束");
  14.                
  15.                
  16.                
  17.         }

  18. }
複製代碼

返回列表