比较这两道题,请高手解答

eshow 2004-02-05 07:24:49
55. Which two CANNOT directly cause a thread to stop executing? (Choose Two) (A,E)
A. Calling the yield method
B. Calling the wait method on an object
C. Calling the notify method on an object
D. Calling the NotifyAll method on an object
E. Calling the start method on another Thread object

60. Which two CANNOT directly cause a thread to stop executing? (Choose Two) (A,C)

A.Existing from a synchronized block
B.Calling the wait method on an object
C.Calling notify method on an object
D.Calling read method on an InputStream object
E.Calling the SetPriority method on a Thread object

以上分别是147题中的55题和60题。题干一样,都是能直接停止一个线程运行的是。但一题选了notify一题没选。是不是矛盾啊?请高手详细解答一下各个选项,这个概念我好象很混淆,谢谢了!

其中我能确定的应该是yield,wait,read可以造成当前线程停止,其他的我觉得都不能直接造成线程停止啊!可偏偏答案还选了yiled。notify 和notifyALL应该是唤醒线程的啊!怎么答案又没有选呢??

...全文
25 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧