其他
心寒!刚写完这段代码,就被开除了…
以下文章来源于Java技术栈 ,作者栈长
* 微信公众号:Java技术栈
*/
public class ArraySort implements Runnable {
private int number;
public ArraySort(int number) {
this.number = number;
}
public static void main(String[] args) {
int[] numbers = new int[]{102, 338, 62, 9132, 580, 666};
for (int number : numbers) {
new Thread(new ArraySort(number)).start();
}
}
@Override
public void run() {
try {
Thread.sleep(this.number);
System.out.println(this.number);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
return true;
} else {
return false;
}
a
b
c
a
b
c