Thread methods of Object Flashcards

1
Q

Causes the thread to wait indefinitly or until the timeout period specified for a thread to call notify() when calling this method. The thread must have the lock of the object specified by this method.

A

void wait()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The JVM chooses a single thread that is waiting for the lock and wakes it up. The thread calling this method must have the lock for the object referenced by this method.

A

void notify()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The JVM wakes up all threads waiting on the lock. The thread calling this method must have the lock for the object referenced by this method.

A

void notifyAll()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly