Question: Reimplement the BankAccount class so that it is immutable. The deposit and withdraw methods need to return new BankAccount objects with the appropriate balance.
Reimplement the BankAccount class so that it is immutable. The deposit and withdraw methods need to return new BankAccount objects with the appropriate balance.
•
Step by Step Solution
3.46 Rating (178 Votes )
There are 3 Steps involved in it
In order to create an immutable class in Java like BankAccount we have to ensure couple of things 1 ... View full answer
Get step-by-step solutions from verified subject matter experts
