generalaccount.java

来自「java 完全探索的随书源码」· Java 代码 · 共 34 行

JAVA
34
字号
/** * A simple class used to implement common behavior for various * types of bank accounts. It should be extended to implement * behavior for specific accounts. */public class GeneralAccount {  // unique account identifier  private String accountNumber;  // this will hold the current account balance  protected float balance;  public GeneralAccount( String accountNum ) {    accountNumber = accountNum;  }  public String getAccountNumber() {    return accountNumber;  }  public float getBalance() {    return balance;  }  public void makeDeposit( float amount ) {    balance += amount;  }  public void makeWithdrawal( float amount ) {    balance -= amount;  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?