customer.java

来自「This project does not contain a full, ru」· Java 代码 · 共 60 行

JAVA
60
字号
package ope.account;


/**
 * The class <CODE>Customer</CODE> represents customers in a 
 * simple (unrealistic) banking system. Each customer has
 * a fixed customer ID number and a name.
 */
public class Customer {

  private int id;                    // fixed value 
  private String name;               // most-recent holder

  
  /**
   * Creates a new normal customer with the given ID number and
   * name.
   * 
   * @param id   the new customer's ID number
   * @param name the new customer's name
   */  
  public Customer(int id, String name) {
    this.id = id;
    this.name = name;
  }
  

  /**
   * Returns the customer's ID number
   * 
   * @return customer ID
   */  
  public int getID() {
    return this.id;
  }
  
  
  /**
   * Returns the customer's name.
   * 
   * @return customer name
   */  
  public String getName() {
    return this.name;
  }
  
  
  /**
   * Sets the customer's name.
   * 
   * @param newName the name to be set for the customer
   */  
  public void setName(String newName) {
    this.name = newName;
  }
  
  
  
}

⌨️ 快捷键说明

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