摘要:
1、通过thread.join()方式,注意:如果有多个子线程,需要将全部的线程先start,然后再join。代码示例如下:public class Main{ public static void main(String[] args) { long start = System.currentTimeMillis(); List list = new ArrayList(); for(int i = 0; i < 5; i++) { Thread thread = new TestThread(); thread.start(); list.add(thread); } try { 阅读全文