Class Customer

java.lang.Object
  |
  +--Customer

public class Customer
extends Object

Class that describes a customer of a bank


Field Summary
(package private)  BankAccount account
          account for this customer
 
Constructor Summary
Customer(String firstName, String lastName, double amount)
          Constructor to create a new customer and create an account for this customer
 
Method Summary
 boolean equals(Object o)
          Method to check if two customer objects are equal (have the same id)
 BankAccount getAccount()
          Method to get the account
 int getId()
          Method to get the id for this customer
 String getName()
          Method to get the customer name
static void main(String[] argv)
          Method to test
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

account

BankAccount account
account for this customer

Constructor Detail

Customer

public Customer(String firstName,
                String lastName,
                double amount)
Constructor to create a new customer and create an account for this customer

Parameters:
firstName - the first name for the customer
lastName - the last name for the customer
amount - the amount to deposit in the new account
Method Detail

getId

public int getId()
Method to get the id for this customer

Returns:
the id for this customer

equals

public boolean equals(Object o)
Method to check if two customer objects are equal (have the same id)

Overrides:
equals in class Object
Returns:
true if the id's are the same, else false

getName

public String getName()
Method to get the customer name

Returns:
the first and last name in a string

getAccount

public BankAccount getAccount()
Method to get the account

Returns:
the bank account for this customer

main

public static void main(String[] argv)
Method to test