2009年2月26日 星期四

第230題

Given that t1 is a reference to a live thread, which is true?
A. The Thread.sleep() method can take t1 as an argument.
B. The Object.notify() method can take t1 as an argument.
C. The Thread.yield() method can take t1 as an argument.
D. The Thread.setPriority() method can take t1 as an argument.
E. The Object.notify() method arbitrarily chooses which thread to notify.
答案:E
參考:13-2 Java執行緒與Thread類別、13-3 Runnable介面、13-5 執行緒的互動處理

-------------------------------------

E. notify() 任意喚醒一條執行緒.

A~D 的方法都不是拿t1作為參數.

沒有留言:

張貼留言