Solved

Assume Three Threads Share a BankAccount Object with a Balance

Question 75

Multiple Choice

Assume three threads share a BankAccount object with a balance initially zero (0) , a ReentrantLock named myLock, and a condition object on myLock named insufficientFunds, as shown below.Thread one calls withdraw(30) , then thread two calls withdraw(20) and thread three calls deposit(45) .What is the balance after the three calls? Assume three threads share a BankAccount object with a balance initially zero (0) , a ReentrantLock named myLock, and a condition object on myLock named insufficientFunds, as shown below.Thread one calls withdraw(30) , then thread two calls withdraw(20)  and thread three calls deposit(45) .What is the balance after the three calls?    A) 0 B) 15 or 25 C) 45 D) -5


A) 0
B) 15 or 25
C) 45
D) -5

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions