java编程,各位高手,越简单越好。

2024-11-19 08:24:51
推荐回答(1个)
回答1:

public class Account{
private String acctNumber;
private String customerName;
private String acctOpenTime;
private String customerIdNum;
private double balance;

public Account(String accoutnNumber){
this.acctNumber = accoutnNumber;
}

public Account openAccount(String accountNumber){
return new Account(accountNumber);
}

public void save(double money){
this.balance += money;
}

public void query(){
System.out.println("Balance is: " + balance);
//....
}

}