对象数组成员要怎么初始化?
namespace Test{ using System; using System.Collections.Generic; internal class Person { public Person() {} public Person(string n,int a) { this.Name = n; this.Age = a; } public string Name { get; set; } public int Age { get; set; } } class Program{ static void Main(string[] args){ // 方案一:泛型集合初始化器 var person = new List
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有