using static System.Console;
public static void Main()
var person = new Person();
person.Name = "Philip Thomas";
person.HomeAddress = new Address { Street = "Comet View Tr SE", City = "Smyrna", State = "GA" };
Person clone = (Person)person.Clone();
clone.Name = "Philip M. Thomas";
clone.HomeAddress.City = "Atlanta";
public class Person : ICloneable {
var clone = (Person)this.MemberwiseClone();
clone.HomeAddress = (Address)this.HomeAddress.Clone();
public override string ToString() {
return $"{nameof(Name)}: {Name}, {nameof(HomeAddress)}: {HomeAddress}";
public string Name { get; set; }
public Address HomeAddress { get; set; }
public class Address : ICloneable {
var clone = (Address)this.MemberwiseClone();
public override string ToString() {
return $"{nameof(Street)}: {Street}, {nameof(City)}: {City}, {nameof(State)}: {State}";
public string Street { get; set; }
public string City { get; set; }
public string State { get; set; }