为什么jion(time)中时间不管是多少,下面的代码始终在之后执行
public class ThreadB extends Thread {
@Override
synchronized public void run() {
try {
System.out.println("begin B ThreadName="
+ Thread.currentThread().getName() + " "
+ System.currentTimeMillis());
Thread.sleep(5000);
System.out.println(" end B ThreadName="
+ Thread.currentThread().getName() + " "
+ System.currentTimeMillis());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public class Run1 {
public static void main(String[] args) {
try {
ThreadB b = new ThreadB();
long start = System.currentTimeMillis();
b.start();
// b.join(700);
long end = System.currentTimeMillis();
System.out.println("====" + (end - start));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}