[java]代码库
class BankAccount{
private String id;
private String mima;
private double money;
private double in;
private double out;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public double getIn() {
return in;
}
public void setIn(double in) {
this.in = in;
}
public String getMima() {
return mima;
}
public void setMima(String mima) {
this.mima = mima;
}
public double getMoney() {
return money;
}
public void setMoney(double money) {
this.money = money;
}
public double getOut() {
return out;
}
public void setOut(double out) {
this.out = out;
}
}
public class test3_2 {
public static void main(String args[]){
BankAccount a= new BankAccount();
a.setId("123456");
a.setMima("159357");
a.setMoney(1500);
a.setIn(5000);
a.setOut(800);
System.out.println("账号:"+a.getId()+"的余额为:"+a.getMoney());
System.out.println("存钱时:"+a.getId()+"的存入额为:"+a.getIn()+",余额为:"+(a.getMoney()+a.getIn()));
System.out.println("取钱时:"+a.getId()+"的取出额为:"+a.getOut()+",余额为:"+(a.getMoney()+a.getIn()-a.getOut()));
}
}