Multiple Choice
Assume two threads share a BankAccount object with balance of zero (0) , and that the BankAccount class provides deposit and withdraw methods and has a ReentrantLock named myLock, as shown below.Note that only the deposit method uses the lock.Thread one deposits $10 ten times and, concurrently, thread two withdraws $10 ten times.Which statement regarding the balance after all thread calls is definitely true?
A) The balance could be zero or positive.
B) The balance is zero.
C) The balance could be zero or negative.
D) The balance is positive.
Correct Answer:

Verified
Correct Answer:
Verified
Q41: What happens if we try to start
Q42: When a sleeping thread is interrupted, an
Q43: In order to unblock a thread after
Q44: When a thread is interrupted, the most
Q45: Insert the statement that would start the
Q47: Consider an old fashioned telephone booth that
Q48: What should be done to get the
Q49: Class MyClass has two ReentrantLock objects, myLock1
Q50: Which argument(s) present(s) the best case(s) for
Q51: In which method are the tasks that