[Java] 数组-01 入门

package com.bjsxt.chap5;

public class Test {
    public static void main(String[] args) {
        Date[] days;
        days = new Date[3];
        for (int i = 0; i < 3; i++) {
            days[i] = new Date(2004, 4, i+1);
        }
    }
}
class Date {
    int year;
    int month;
    int day;
    Date(int y, int m, int d) {
        year = y;
        month = m;
        day = d;
    }
}

posted @ 2013-11-24 19:41  小尼人00  阅读(139)  评论(0编辑  收藏  举报