Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : WAITING

Advertisement

Detailed Solution

सही उत्तर WAITING है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

In Java, when a thread invokes the wait() method on an object, it enters which thread state? / Java में, जब कोई थ्रेड किसी ऑब्जेक्ट पर wait() मेथड कॉल करता है, तो वह किस थ्रेड अवस्था में प्रवेश करता है?

1.
BLOCKED
2.
RUNNABLE
3.
TERMINATED
4.
WAITING

Correct Answer: WAITING

Object.wait() with no timeout puts the thread in the WAITING state until another thread calls notify() or notifyAll(). BLOCKED is for threads waiting on a monitor lock, and TIMED_WAITING is used for wait(timeout). / बिना टाइमआउट वाला Object.wait() थ्रेड को WAITING अवस्था में डाल देता है जब तक कोई अन्य थ्रेड notify() या notifyAll() न कॉल करे। BLOCKED मॉनिटर लॉक की प्रतीक्षा के लिए है, और TIMED_WAITING wait(timeout) के लिए प्रयुक्त होता है।

Downloaded from PrepSnap (prepsnap.in)