
class Employee{ private int employeeID; private string firstname; private string lastname; private bool eligibleOT; private int positionID; private string positionname; private ArrayList arrPhone; private ArrayList arrSector; 如你所见,我创建了一个名为arrSector的数组.它采用员工关联的部门的名称.现在我也想把行业ID和行业名称一起考虑.
我的问题是如何在单个arrayList变量中实现扇区ID和扇区名称.
我想将扇区ID的值和扇区名称一起存储.
任何帮助表示赞赏.
public class Sector{ public string name { get; set; } public int ID { get; set; }} 然后使用通用List而不是ArrayList.
class Employee{ private int employeeID; private string firstname; private string lastname; private bool eligibleOT; private int positionID; private string positionname; private ArrayList arrPhone; private List<Sector> arrSector;} 总结 以上是内存溢出为你收集整理的C#中的Arraylist全部内容,希望文章能够帮你解决C#中的Arraylist所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)