一个线程要运行必需用start方法启动它。没有start就调用join()没有什么意义。
什么时候用join是让人比较费解。

解决方案 »

  1.   

    两个线程运行时用join(),还是不用时结果都不一样。真是不知道是什么意思。
      

  2.   

    两个线程运行时用join(),还是不用时结果都不一样。真是不知道是什么意思。
      

  3.   

    jion()等待所调用的线程都结束,最长用到的地方是保证主线程最后结束
      

  4.   

    join
    public final void join()
                    throws InterruptedException
    Waits for this thread to die.
    Throws:
    InterruptedException - if another thread has interrupted the 
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    current thread. The interrupted status of the current thread
    ~~~~~~~~~~~~~~
    is cleared when this exception is thrown.
      

  5.   

    多谢楼上的兄弟,可是我还是没懂!
    我想问的是这个join到底有什么用,比如说等待线程死亡是怎么等待的,是不是到这个地方程序就不向下走了?
    今天我的例题没拿来,改天我写上一个程序上去还请你多多指点。