I need to create a bank account class which consists of deposit and withdraw methods. I need to have classes that inherit from superclass, a current account and savings account and a test/driver class that calls all methods and operates the system?
something like:
public abstract class BankAccount {
private double balance;
public BankAccount() {
balance = 0.;
}
public void deposit(double amount) {
balance += amount;
}
public withdraw(double amount) {
// check...
balance -= amount;
}
}
public class CurrentAccount extends BankAccount {
// additional stuff
}
public class SavingsAccount extends BankAccount {
// aditional stuff
}