public class Person { public string Name { get; } public Address HomeAddress { get; } public Person(string name, Address homeAddress) { Name = name; HomeAddress = homeAddress; } // 嵌套类:Address 被视为 Person 的一部分 public class Address { public string City { get; } public string Street { get; } public Address(string city, string street) { City = city; Street = street; } } }