标签:
class Program
{
static void Main(string[] args)
{
man mm = new man();
mm[0] = "jingya";
mm[1] = "dongbao";
mm[2] = "xiaolizi";
mm[3] = "xializi";
for (int i = 0; i < 10 ; i++)
{
Console.WriteLine(mm[i]);
}
Console.ReadKey();
}
}
class man
{
public man()
{
for (int i = 0; i < 10; i++)
{
manlist[i] = "N.A.";
}
}
private string[] manlist = new string[10]; // 其实外面的索引器就是在这里给定义好大小的,这就是这个方法的局限性
public string this[int index]
{
set { manlist[index] = value; }
get { return manlist[index]; }
}
}
// System.Windows.Forms.Control
Control[] arrCtrl = new Control[5];
arrCtrl[0] = new Button();
arrCtrl[3] = new Label();
a[] s =new a[10];
s.add()
int[] aa = new int[10];
aa[0] = 0;
标签:
原文地址:http://www.cnblogs.com/weloveshare/p/5295043.html