initial commit

This commit is contained in:
2022-04-14 13:57:08 +02:00
parent a6ae1323d2
commit fb69c498bf
21 changed files with 1209 additions and 5 deletions

24
src/bank/BankAccount.java Normal file
View File

@@ -0,0 +1,24 @@
package bank;
public abstract class BankAccount {
protected double balance;
protected String owner;
public double getBalance() {
return balance;
}
public void deposit(double amount){
balance += amount;
}
public boolean withdraw(double amount){
if(balance<amount) return false;
balance -= amount;
return true;
}
@Override
public String toString() {
return owner + " have " + balance + "CHF on his account.";
}
}