怎么让以下代码是按顺序输出的?
public class Main3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
new MyThread(1).start();
new MyThread(2).start();
new MyThread(3).start();
new MyThread(4).start();
new MyThread(5).start();
new MyThread(6).start();
new MyThread(7).start();
}
}
class MyThread extends Thread {
private int i = 0;
public MyThread(int i){
this.i = i;
}
@Override
public void run() {
System.out.println(i);
}
}