// Copy constructor
 public PersonWithCopyConstructor(PersonWithCopyConstructor other)
 {
     Names   = (string[])other.Names.Clone();
     Address = new AddressWithCopyConstructor(other.Address);
 }
 public PersonWithCopyConstructor(string[] names, AddressWithCopyConstructor address)
 {
     Names   = names ?? throw new ArgumentNullException(nameof(names));
     Address = address ?? throw new ArgumentNullException(nameof(address));
 }
Beispiel #3
0
 // Copy constructor
 public AddressWithCopyConstructor(AddressWithCopyConstructor other)
 {
     StreetName  = other.StreetName;
     HouseNumber = other.HouseNumber;
 }