📄 customer.java
字号:
/** A bank customer with a checking and savings account.*/import java.io.*;public class Customer implements Serializable{ /** Constructs a customer with a given number and PIN. @param aNumber the customer number @param PIN the personal identification number */ public Customer(int aNumber, int aPin) { customerNumber = aNumber; pin = aPin; checkingAccount = new BankAccount(aNumber,aPin); savingsAccount = new BankAccount(aNumber,aPin); } /** Tests if this customer matches a customer number and PIN. @param aNumber a customer number @param aPin a personal identification number @return true if the customer number and PIN match */ public boolean match(int aNumber, int aPin) { return customerNumber == aNumber && pin == aPin; } /** Gets the checking account of this customer. @return the checking account */ public BankAccount getCheckingAccount() { return checkingAccount; } /** Gets the savings account of this customer. @return the checking account */ public BankAccount getSavingsAccount() { return savingsAccount; } private int customerNumber; private int pin; private BankAccount checkingAccount; private BankAccount savingsAccount;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -