Trong đoạn mã dưới đây, câu trả lời luôn là Bắt đầu 0 1 2 3 Hoàn thành. Tôi chỉ tự hỏi làm thế nào nó có thể xảy ra.
public class TestOne extends Thread {
/**
* @param args
*/
public static void main(String[] args)throws Exception {
// TODO Auto-generated method stub
Thread t = new Thread(new TestOne());
t.start();
System.out.println("started");
t.join();
System.out.println("Complete");
}
public void run(){
for(int i=0;i<4;i++){
System.out.println(i);
}
}