class MyDate{
private int day;
private int month;
private int year;
public MyDate(int a,int b,int c){
day = a; month = b; year = c;
}
public void display(){
System.out.println(day+"-"+month+"-"+year);
}
}
public class TestArr_1 {
public static void main(String[] args) {
MyDate[] se;//MyDate
se = new MyDate[10];
for (int i=0;i<10;i++)
{
se[i] = new MyDate(i+1,i+1,2001+i);
se[i].display();//这里表示不理解,se.display这样是对象调用一个方法(虽然不能这样写),这里算什么呢
}
}
}
|