Solved

Consider the Following Change to the Deposit Method in Section

Question 50

Multiple Choice

Consider the following change to the deposit method in Section 20.4:
Public void deposit(double amount)
{
BalanceChangeLock.lock() ;
Try
{
Double newBalance = balance + amount;
Balance = newBalance;
}
Finally
{
BalanceChangeLock.unlock() ;
}
System.out.println("Depositing " + amount + ", new balance is " + balance) ;
}
What is the consequence of this change?


A) The bank account balances may no longer be correctly updated.
B) The printouts may become intermingled.
C) The printouts may no longer display the correct balances.
D) All of the above.

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents