论坛新手提问。求论坛的大虾们指导~~
下面这段代码为什么输出的是日期的地址。不是日期呢?怎么解决啊、?class MyDate
{
int day,month,year;
MyDate()
{
day=1;
month=1;
year=2000;
}
MyDate(int day1,int month1,int year1)
{
day=day1;
month=month1;
year=year1;
}
class Employee
{
String name;
MyDate birthDate;
MyDate HireDate;
Employee()
{
}
Employee(String name1,MyDate birthDate1,MyDate HireDate1)
{
name=name1;
birthDate=birthDate1;
HireDate=HireDate1;
}
public String getDetail()
{
return "雇员姓名:"+name+" 出生日期为:"+birthDate+" 工作日期为:"+HireDate+"\n";
}
}
class Test2
{
public static void main (String args[])
{
MyDate bir=new MyDate(5,5,2002);
MyDate hir=new MyDate(2,3,2002);
Employee xiaoming=new Employee("小明",bir,hir);
System.out.print(xiaoming.getDetail());
}
}