Back to Examples
package edu.iuk.BankProject1;

import java.io.Serializable;

public class Customer implements Serializable {

  //Declare Variables
  private String customerID;
  private String customerName;
  private String customerPhone;

  /**
  *
  * Customer constructor requiring three
  * attributes to create. Subclasses will be forced to call
  * this constructor and set these required values.
  *
  * @param customerID String the customer's Identification
  * @param customerName String the customer's name.
  * @param customerPhone String the customer's Phone number.
  */

  //Constructors
  public Customer(){

    this.customerName = "";
    this.customerPhone = "";

  }

  //Constructor
  public Customer(String customerID, String customerName, String customerPhone){

    this.customerID = customerID;
    this.customerName = customerName;
    this.customerPhone = customerPhone;

  }

  //Sets and Gets
  public String getCustomerID(){

    return this.customerID;

  }
  public String getCustomerName(){

    return this.customerName;

  }
  public String getCustomerPhone(){

    return this.customerPhone;

  }

  public void setCustomerID(String customerID){

    this.customerID = customerID;

  }

  public void setCustomerName(String customerName){

    this.customerName = customerName;

  }

  public void setCustomerPhone(String customerPhone){

    this.customerPhone = customerPhone;

  }

  /**
  *
  * displayCustomerInformation is used to display the customer's information in the console.
  *
  * no parameters
  *
  **/
  public String displayCustomerInformation(){

    String output = "Customer Information:\n";
    output += "Customer ID: " + this.customerID;
    output += "\nCustomer Name: " + this.customerName;
    output += "\ncustomer Phone: " + this.customerPhone;
    return output;

  }

}
Back to Examples

Startup Discount
Small Business?
Contact us for an Enormous Discount!