public class CheckingAccount {
    private double balance;
    private final int number;
    public CheckingAccount(int number) {
        this.number = number;
    }
    public double getBalance() {
        return balance;
    }
    public int getNumber() {
        return number;
    }
    public void deposit(double amount) {
        balance += amount;
    }
    public void withdraw(double amount) throws InsufficientFundsException {
        if(amount <= balance) {
            balance -= amount;
        }else {
            throw new InsufficientFundsException();
        }
    }
    @Override
    public String toString() {
        return "Account number: " + number + ", Balance: " + balance;
    }
}
