可我浪费着我寒冷的年华

c#数组

00x1 【一维数组】

  数组是多个相同类型的数据组合。数组属引用类型。

  一维数组的声明:

    int [] a;    //前面加修饰符然后加中括号,a为数组名。注意括号是写在数组名的前面的。

  数组的初始化:

    int [] w=new int[3];

    w[0]=222;

    w[1]=333;

    w[2]=666;

  或

    MyDate [] w; //MyDate是对象型的。

    dates = new MyDates[3]; //定义这个对象的长度为3

    dates[0] = nenw MyDates[1,2,3,];

    dates[1] = new MyDates[2,3,4];

    dates[2] = new MyDates[3,4,5]; //默认是从零开始。

    

 

posted @ 2017-05-02 01:14  珍惜少年时  阅读(220)  评论(0编辑  收藏  举报
可我浪费着我寒冷的年华