以下是引用片段: public class Person ...{private string _firstName;private string _lastName;private int _age;public string FirstName ...{get ...{return _firstName;}set ...{_firstName = value;}}public string LastName ...{get ...{return _lastName;}set ...{_lastName = value;}}public int Age ...{get ...{return _age;}set ...{_age = value;}}} |
以下是引用片段: public class Person ...{public string FirstName ...{get; set;}public string LastName ...{get; set;}public int Age ...{get; set;}} |
以下是引用片段: public class Person ...{public string FirstName ...{ get; set; }public string LastName ...{ get; set; }public int Age ...{ get; set; }} |
以下是引用片段: Person person = new Person();person.FirstName = "Scott";person.LastName = "Guthrie";person.Age = 32; |
以下是引用片段: Person person = new Person ...{ FirstName="Scott", LastName="Guthrie", Age=32 }; |
以下是引用片段: Person person = new Person ...{FirstName = "Scott",LastName = "Guthrie"Age = 32,Address = new Address ...{Street = "One Microsoft Way",City = "Redmond",State = "WA",Zip = 98052}}; |
以下是引用片段: List people = new List();people.Add( new Person ...{ FirstName = "Scott", LastName = "Guthrie", Age = 32 } );people.Add( new Person ...{ FirstName = "Bill", LastName = "Gates", Age = 50 } );people.Add( new Person ...{ FirstName = "Susanne", LastName = "Guthrie", Age = 32 } ); |
以下是引用片段: List people = new List ...{new Person ...{ FirstName = "Scott", LastName = "Guthrie", Age = 32 },new Person ...{ FirstName = "Bill", LastName = "Gates", Age = 50 },new Person ...{ FirstName = "Susanne", LastName = "Guthrie", Age = 32 }}; |
新闻热点
疑难解答