休眠排序

2020-11-03  本文已影响0人  Djbfifjd
public class testMain {
    public static void main(String[] args) {
        int[] array = {18, 66, 36, 98, 100, 203, 22};
        for (int i : array) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        Thread.sleep(i);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(i);
                }
            }).start();
        }
    }
}
上一篇 下一篇

猜你喜欢

热点阅读