import java.io.*;
class MyDate
{
int d,m,y;
String ds;
MyDate(int d,int m,int y)
{
this.d=d;
this.m=m;
this.y=y;
}
public String getDate()
{
ds=d+"-"+m+"-"+y;
return ds;
}
}
class Emp
{
int id;
String name,add;
MyDate dob,doj;
Emp(int id,String name,String add,MyDate dob,MyDate doj)
{
this.id=id;
this.name=name;
this.add=add;
this.dob=dob;
this.doj=doj;
}
public void display()
{
System.out.println(id+name);
System.out.println(add + " " +dob.getDate()+ " "+doj.getDate());
}
}
class EmpMain
{
public static void main(String args[])
{
MyDate dob=new MyDate(10,12,1980);
MyDate doj=new MyDate(1,1,2010);
System.out.println(doj);
Emp e=new Emp(10,"XYZ","Bardoli",dob,doj);
e.display();
}
}
class MyDate
{
int d,m,y;
String ds;
MyDate(int d,int m,int y)
{
this.d=d;
this.m=m;
this.y=y;
}
public String getDate()
{
ds=d+"-"+m+"-"+y;
return ds;
}
}
class Emp
{
int id;
String name,add;
MyDate dob,doj;
Emp(int id,String name,String add,MyDate dob,MyDate doj)
{
this.id=id;
this.name=name;
this.add=add;
this.dob=dob;
this.doj=doj;
}
public void display()
{
System.out.println(id+name);
System.out.println(add + " " +dob.getDate()+ " "+doj.getDate());
}
}
class EmpMain
{
public static void main(String args[])
{
MyDate dob=new MyDate(10,12,1980);
MyDate doj=new MyDate(1,1,2010);
System.out.println(doj);
Emp e=new Emp(10,"XYZ","Bardoli",dob,doj);
e.display();
}
}
No comments:
Post a Comment