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

2024年11月19日 08:24
有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);
//....
}

}