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 chose 1,2. The correct answer is 2,3. Why is 1 wrong? wait method causes thread to go from Running to Waiting state, doesn't it? Why is 3 right? notify method causes only 1 thread (not all waiting threads) to go from waiting to runnable, right?
Which of these are core interfaces in the collection framework. Select the one correct answer.