public class Useconstruct {
public Useconstruct() {
}
class Mydata{
private int day;
private int mouth;
private int year;
public Mydata(){
day = 12;
mouth=12;
year=1986;
}
public Mydata(int y){
day=1;
mouth=05;
year=y;
}
public Mydata(int d,int m,int y){
day=d;
mouth=m;
year=y;
}
public void display(){
System.out.println(day+"-"+mouth+"-"+year);
}
public static void main(String[] args){
Mydata m1=new Mydata();
Mydata m2=new Mydata(2000);
Mydata m3=new Mydata(1,01,2005);
m1.display();
m2.display();
m3.display();
}
}
}
PS:41行到43行错了!