Shadow Clone - Only Self Class was cloned. (Child Class No Clone)
Deep Clone - Self and Child Class was cloned.
public Customer GetClone()
{
Customer customer;
customer = (Customer)this.MemberwiseClone();
customer.address = (Address)address.GetClone();
return customer;
}
public Address GetClone()
{
Address address;
address = (Address)this.MemberwiseClone();
return address;
}
Customer customerB = null;
customerB = customerA.GetClone();
No comments:
Post a Comment