package zhanghu;
public class Test {
public static void main(String[] args) {
Account a=new Account();
System.out.println(a.deposit(1000));
System.out.println(a.withdraw(1000));
System.out.println(a.deposit(6000));
}
}
package zhanghu;
public class Account {
private long id;
private int password;
private String name,personID,email;
private double balance;
public Account() {
this.name="张三";
this.balance=1000;
}
public Account(long id, int password, String personID, String email) {
this.id = id;
this.password = password;
this.personID = personID;
this.email = email;
}
public double deposit(double money){
return this.balance+=money;
}
public double withdraw(double money){
return this.balance-=money;
}
}