Question: * Interface Comparable +compareTo (E obj): int Interface Closable +isclosable (): boolean has Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (String

![has Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (String](https://s3.amazonaws.com/si.experts.images/answers/2024/02/65bc5de7e6d98_62365bc5de7bf8b9.jpg)
* "Interface" Comparable +compareTo (E obj): int "Interface" Closable +isclosable (): boolean has Bank -accounts: BankAccount [] -count: int +Bank (String filename) -readAccounts (String filename) : void +find (long number): BankAccount +add (BankAccount ba): boolean +remove (long number): boolean +viewAll (): void +viewClosable(): void +sort (): void +saveAccounts (String filename) : void BankAccount -number: long. -owner: String #balance: double #BankAccount (String owner, double balance) #BankAccount (long number, String owner, double balance) +getNumber () : long +getOwner (): String +getBalance (): double +deposit (double amount) : void +withdraw (double amount) :boolean +toString(): String +simpleString(): String +compareTo (BankAccount ba): int +isclosable (): boolean The class Bank does not extend BankAccount, but uses objects of type BankAccount. This type of relationship is called composition or a has relationship. The class Bank holds an array of type BankAccount and provides methods to manipulate the list of accounts stored in the bank. In addition to find/add/remove/view operations, the bank also loads/saves the list of bank accounts from/to a text file. When a Bank instance is created, the array accounts is created with a capacity of 100. The number of accounts loaded from the file to the array accounts is not always equal to 100 and therefore the data member count is used to indicate the number of accounts stored in the array.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
