package com.models; public class BankAccount { public static final String UNKNOW = "unknown"; private String name; private float balance; private int number; public BankAccount() { setName(UNKNOW); setBalance(0.0f); setNumber(0); } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setBalance(float balance) { this.balance = balance; } public float getBalance() { return balance; } public void setNumber(int number) { this.number = number; } public int getNumber() { return number; } public void deposit (float amount){ setBalance(getBalance() + amount); } public void withdraw (float amount) throws Exception{ if (getBalance() < amount) throw new Exception(); setBalance(getBalance() - amount); } }