多线程中
Thread test1= new Thread(gets);
Thread test2= new Thread(gets);
test1.start();
test2.start();
if(j==3){
try {
test2.join();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
if(j==7){
try {
test2.join();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
如果线程中有输出的话,.jion()就会没用。暂时还不知道是为什么,以后有空再研究!