用Account类来模拟一台ATM机
Account类源码:
import java.util.Date;
public class Account {
private int id = 0;
private double balance = 0;
private static double annualInterestRate = 0;
private Date dateCreated;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public double getAnnualInterestRate() {
return annualInterestRate;
}
public void setAnnualInterestRate(double annualInterestRate) {
this.annualInterestRate = annualInterestRate;
}
public Date getDateCreated() {
return dateCreated;
}
public Account() {
}
public Account(int id, double balance) {
this.id = id;
this.balance = balance;
}
public static double getMonthlyInterestRate() {
return annualInterestRate / 12;
}
public void withDraw(double money) {