Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help for Mock Exam

 
Bin Zhao
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO.37 in JavaPrepare.com's test
Which of the following statements are true. Select all correct answers.
a)The wait method defined in the Thread class, can be used to convert a thread from Running state to Waiting state.
b)The wait(), notify(), and notifyAll() methods must be executed in synchronized code.
c)The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state.
d)The Thread class is an abstract class.
the answer is b) and c), why a) is wrong?
Can anyone explain?
Thanks
 
Jane Zheng
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
public final void wait() is defined in Object, not in Thread. And since it is final, no one could override it.
Correct me, if I am wrong.
Jane Z.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic