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 .
j=0,这时主线程让出,开始进行run(),然后线程睡眠5秒,在此其间,没有别的线程中断该线程,所以不会产生异常,所以j不会等于100
对了,我还不知道答案是什么呢,我说的对不?
我也认为答案是2。
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 .