当前位置: 技术问答>java相关
请看看关于线程的两道题。
来源: 互联网 发布时间:2015-11-15
本文导语: 55. Which two CANNOT directly cause a thread to stop executing? (Choose Two) 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. C...
55. Which two CANNOT directly cause a thread to stop executing? (Choose Two)
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
ANS: A,E
60. Which two CANNOT directly cause a thread to stop executing? (Choose Two)
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
ANS :A,C
不清楚notify()方法到底能不能使一个线程停止执行!?
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
ANS: A,E
60. Which two CANNOT directly cause a thread to stop executing? (Choose Two)
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
ANS :A,C
不清楚notify()方法到底能不能使一个线程停止执行!?
|
我刚考完SCJP,可以告诉你,很多这些题目本身就是错的
考试的时候的题目不会这么烂,线程的题目都是有明确的解的
55 . A 不一定能让一个线程停止运行,比如只有一个线程的时候,或者这个线程的级别最高
notify ,notifyAll 当然更不能呀,不信自己写个程序看看就知道了
考试的时候的题目不会这么烂,线程的题目都是有明确的解的
55 . A 不一定能让一个线程停止运行,比如只有一个线程的时候,或者这个线程的级别最高
notify ,notifyAll 当然更不能呀,不信自己写个程序看看就知道了
|
答案错了吧,60选C而55不选C?
|
notify()能使线程中止?没有听说过,我决得答案应该是:
55: c,d
60: a,c
55: c,d
60: a,c