http://community.csdn.net/Expert/TopicView1.asp?id=3222720

解决方案 »

  1.   

    public class test {

    public static String muteObj = new String();

    public static void main(String[] args) {

    try {
    AnotherThread at = new AnotherThread();
    at.start();                           at.join();
    System.out.println("before wait..." + Thread.currentThread().getClass().getName());
    //statement 1
    muteObj.wait();
    System.out.println("after wait...");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
      

  2.   

    Thread.currentThread().getClass().getName());
             at.join();//加多这一行
    //statement 1
      

  3.   

    to bluesmile979(笑着) and maowu(猫呜)
    非常感谢,可是我的at 是Runnable 而不是 Thread, 这该怎么办呢?
      

  4.   

    AnotherThread at = new AnotherThread();
    Thread t = new Thread(at);
                                t.start();
                                t.join();
                               //这样不是很好好吗?