設計一個日期類MyDate?
class MyDate{ private int year; private int month; private int day; public MyDate(int year,int month,int day){ this.year=year; this.month=month; this.day=day; } public int getYear(){ return yea; } public int getMonth(){ return month; } public int getDay(){ return day; } public void showDate(){ System.out.println(year+年+month+月+dat+日); } }