Project I: Bank
public class Account {
private double balance;
private String name;
public Account(double balance, String name)
{
this.balance = balance;
this.name = name;
}
public void deposit(double m)
{
balance+=m;
}
public double getBalance()
{
return balance;
}
public String getName() {
return name;
}
public void withdraw(double w)
{
if(balance>=w)
{
balance-=w;
}
}
}任务:
Last updated