import java.io.IOException;
import java.util.*;
public class Main {
public static void main(String[] args) {
int a[]={1,3,5,7,9,2,4,6,8,10};
for (int i=0;i<10;i++)
{
new testTread(a[i]).start();
}
}
}
// 继承Thread类
class testTread extends Thread {
public int a;
// 获取参数
testTread(int b) {
a = b;
}
// 输出排序
void outShort()
{
System.out.println(a);
}
// 重写run方法,谁先sleep完谁先输出
public void run() {
try {
Thread.sleep(a);
} catch (InterruptedException e) {
}
outShort();
}
}



