You have join the t1 to main
显示100.跟j=100在哪里没关系。new s()的时候j=100就被走到了。

解决方案 »

  1.   

    我觉得当t1.start()后,主线程继续进行,所以先运行System.out.println(t1.j),这时候
    j=0,这时主线程让出,开始进行run(),然后线程睡眠5秒,在此其间,没有别的线程中断该线程,所以不会产生异常,所以j不会等于100
      

  2.   

    在线程休眠期间如果被调用了interrupt方法,则会抛出异常,使j=100,题目中并没有这样的调用,所以不会产生异常,j也就不会等于100。
    对了,我还不知道答案是什么呢,我说的对不?
      

  3.   

    注意花括号!j=100语句不在catch里面。
    我也认为答案是2。
      

  4.   

    I think the answer should be 3.
    coz 1:the two threads here have the same priority, so the main thread has right to run first than the t1.
    2.when main thread running first, j is still 100, the only way to let main to give up s suspend or yield.
    any further discuss is welcomed .