|
//习题2.2 import java.util.*; class MyDate{ private int year; private int month; private int day;
public MyDate(int y,int m,int d){//构造函数,构造方法 year=y; month=m; day=d;
}//end public MyDate(int y,int m,int d) public int getYear(){//返回年 return year; }//end getYear()
public int getMonth(){//返回月 return month; }//end getMonth()
public int getDay(){//返回日 return day; }//end getDay() }//end class MyDate class Employee{
private String name; private double salary; private MyDate hireDay;
public Employee(String n,double s,MyDate d){
|
|