Banks
Banks
this.accountID = accountID;
this.balance = initialBalance;
return accountID;
return balance;
if (amount > 0) {
balance += amount;
} else {
System.out.println("Invalid deposit amount");
this.balance = balance;
super(accountID, initialBalance);
this.interestRate = interestRate;
@Override
setBalance(balance - amount);
} else {
super(accountID, initialBalance);
this.overdraftLimit = overdraftLimit;
@Override
setBalance(balance - amount);
} else {
accounts.add(account);
if (account.getAccountID().equals(accountID)) {
return account;
return null;
bank.addAccount(current);
// Performing operations
savings.deposit(200);
savings.withdraw(300);
current.deposit(150);
current.withdraw(700);
// Accessing accounts
if (acc1 != null) {