Multiple Choice
Class MyClass has a single ReentrantLock object, myLock.Suppose thread one calls myLock.lock() as it enters methodX and immediately completes its CPU time slice.What will happen as thread two calls methodY and attempts to call myLock.lock() ?
A) Thread two will wait for the lock.
B) Thread two will acquire the lock.
C) Deadlock will occur.
D) Thread two causes the IllegalStateMonitorException.
Correct Answer:

Verified
Correct Answer:
Verified
Q7: Suppose run1 and run2 are objects of
Q8: For threads of equal priority, which is
Q9: Which method do you call to make
Q10: Which are ways that a thread can
Q11: Examine the SharedData class shown below.Suppose two
Q13: Assume two threads share a BankAccount object
Q15: Assume two threads share a BankAccount object
Q16: lock objects ensure that shared data are
Q17: Which of the following scenarios may not
Q105: What is the difference between the result