Multiple Choice
Consider an old fashioned telephone booth that can be occupied by one person at a time. Suppose one person went in and dialed a part of her number, and had to leave the booth. A second person went in and dialed a part of his number, and before the number was fully dialed, a connection to some other phone was made. What Java threads analogy would prevent this undesirable scenario?
I Acquire the lock prior to entering the booth
II Dial a complete number when inside the booth
III Hang up the phone and release the lock upon exiting the booth
A) I
B) I and II
C) I and III
D) I, II and III
Correct Answer:

Verified
Correct Answer:
Verified
Q12: Class MyClass has a single ReentrantLock object,
Q35: a(n. _ object is used to control
Q41: What happens if we try to start
Q68: Assume three threads share a BankAccount object
Q70: If you do not use the Runnable
Q71: Which are ways that a thread can
Q73: Which of the following statements is correct?<br>A)If
Q74: Assume two threads share a BankAccount object
Q75: Suppose thread one is downloading a 800KB
Q78: Suppose thread one is downloading a 800KB