【发布时间】:2015-10-24 02:02:13
【问题描述】:
我目前有这个代码:
List<int> list = new List<int>();
list.Add(0);
list.Add(1);
list.Add(2);
list.Add(3);
color0 = list[1];
color1 = list[2];
color2 = list[3];
color3 = list[4];
有没有可能的方法,这个列表可以在 1 个元素中包含 2 个参数?我的意思是:
List<int,int> list = new List<int,int>();
list.Add(0,3);
list.Add(1,8);
color0=list[1][2]; //output 3
color1=list[1][1]; //output 0
color2=list[2][2]; //output 8
color3=list[2][1]; //output 1
有没有可能我可以实现类似的东西?
【问题讨论】:
标签: c# arraylist int arguments