Which two statements are true?
1.
|
Which two statements are true?
- Deadlock will not occur if wait()/notify() is used
- A thread will resume execution as soon as its sleep duration expires.
- Synchronization can prevent two objects from being accessed by the same thread.
- The wait() method is overloaded to accept a duration.
- The notify() method is overloaded to accept a duration.
- Both wait() and notify() must be called from a synchronized context.
|
A. |
1 and 2 |
B. |
3 and 5 |
C. |
4 and 6 |
D. |
1 and 3 |
Answer» D. 1 and 3
|
|