| 1 | b
c
h
| notify
notifyAll
wait
| |
| 2 | e
g
| sleep
yield
| |
| 3 | d
h
i
| resume
stop
suspend
| |
| 4 | a
e
h
| join
sleep
wait
| |
| 5 | a
e
h
| join
sleep
wait
| |
| 6 | b
c
f
| notify
notifyAll
wait
| |
| 7 | d
| InterruptedException
| |
| 8 | b
| A member variable that is an object reference
| |
| 9 | b
e
f
g
h
i
| A compile-time error occurs if the expression produces a value of any primitive type
If execution of the block completes normally, then the lock is released
If execution of the block completes abruptly, then the lock is released
A thread can hold more than one lock at a time
Synchronized statements can be nested
Synchronized statements with identical expressions can be nested
| |
| 10 | a
| The process of executing a synchronized method requires the thread to acquire a lock
| |
| 11 | c
d
e
f
| The Ready state to the Running state
The Running state to the Not-Runnable state
The Running state to the Ready state
The Not-Runnable state to the Ready state
| |
| 12 | b
c
d
f
| The Thread.yield method might cause the thread to move to the Ready state
The same thread might continue to run after calling the Thread.yield method
The Thread.yield method is a static method
The Thread.sleep method causes the thread to move to the Not-Runnable state
| |
| 13 | a
|
Thread.yield method
| |
| 14 | e
| None of the above
| |
| 15 | b
| Ready
| |
| 16 | b
d
e
h
| The Thread.start method causes a new thread to get ready to run at the discretion of the thread scheduler
The Runnable interface declares the run method
The Thread class implements the Runnable interface
Some implementations of the Thread.yield method will not yield to a thread of lower priority
| |
| 17 | a
c
f
|
Thread.MAX_PRIORITY == 10
Thread.NORM_PRIORITY == 5
Thread.MIN_PRIORITY == 1
| |
| 18 | b
d
| A program will terminate only when all user threads stop running
A thread inherits its daemon status from the thread that created it
| |
| 19 | a
| Prints: A
| |
| 20 | e
| Prints: T1T1T3
| |
| 21 | e
| Compile-time error
| |
| 22 | e
| An IllegalThreadStateException is thrown at run-time
| |