public class Date{
private int year,month,day;
public Date(){
}
public void input_Date(int year,int month,int day){
this.year = year;
this.month = month;
this.day = day;
}
public void output_Date(){
System.out.println("日期是:"+year+"年"+month+"月"+day+"日");
}
}
//测试类
public class Test{
public static void main(String args[]){
Date date = new Date();
Scanner input = new Scanner(System.in);
System.out.println("请输入年月日:");
int year = input.nextInt();
int month = input.nextInt();
int day = input.nextInt();
date.input_Date(year,month,day);
date.output_Date();
}
}
分别实现日期的什么?