sjm.examples.cloning
Class OrderFlawed
java.lang.Object
|
+--sjm.examples.cloning.OrderFlawed
- public class OrderFlawed
- extends java.lang.Object
- implements java.lang.Cloneable
This class has a flawed public clone() method.
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
customer
protected Customer customer
OrderFlawed
public OrderFlawed(Customer customer)
- Construct a customer.
clone
public java.lang.Object clone()
- Return a copy of this object.
- Overrides:
- clone in class java.lang.Object
- Returns:
- a copy of this object
getCustomer
public Customer getCustomer()
- Get this order's customer.
- Returns:
- Customer
setCustomer
public void setCustomer(Customer customer)
- Set the customer for this order.
- Parameters:
customer - Customer