• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javaprepare.com mock exam

 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements are true. Select the two correct answers.
1. The wait method defined in the Thread class, can be used to convert a thread from Running state to Waiting state.
2. The wait(), notify(), and notifyAll() methods must be executed in synchronized code.
3. The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state.
4. The Thread class is an abstract class.

I think 1, 2,3 are correct. Am i right?
 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wait method is defined in Object not in Thread.
 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Your explanation helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic