主线程在所有子线程结束后 在继续执行
"主"线程等那10个线程结束后继续
System.out.println(
"start"
);
List<Thread> list =
new
ArrayList<Thread>();
for
(
int
i =
0
; i <
10
; i ++){
Thread t =
new
SelectThread(sql,i*interval+
1
,interval, result);
list.add(t);
t.start();
}
for
(Thread t : list)
t.join();
System.out.println(
"end"
);