// 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)); }
// Copy constructor public AddressWithCopyConstructor(AddressWithCopyConstructor other) { StreetName = other.StreetName; HouseNumber = other.HouseNumber; }