• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sample question on threads

 
Randall Twede
Ranch Hand
Posts: 4371
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "correct" answers are B and C
I do not understand answer B.
You do not have to call these methods.
 
Randall Twede
Ranch Hand
Posts: 4371
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh i think i figured it out. he meant that is the only place they can be executed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic