Class Cls Employee 44
Class Cls Employee 44
{
int EmpId, EAge;
string EName, Eaddress;
public ClsEmployee4()
{
Console.WriteLine("Enter the Employee
Details:-");
this.EmpId =
Convert.ToInt32(Console.ReadLine());
this.EName = Console.ReadLine();
this.Eaddress = Console.ReadLine();
this.EAge = Convert.ToInt32(Console.ReadLine());
}
public ClsEmployee4(ClsEmployee4 ObjTemp)
{
this.EmpId = ObjTemp.EmpId;
this.EName = ObjTemp.EName;
this.Eaddress = ObjTemp.Eaddress;
this.EAge = ObjTemp.EAge;
}
public void DisplayEmpData()
{
Console.WriteLine("Employee Id is:-"+ EmpId);
Console.WriteLine("Employee Name is:-"+ EName);
Console.WriteLine("Employee address
is:-"+Eaddress);
Console.WriteLine("Employee Age is:-"+EAge);
}
}
class Clsconstructor
{
static void Main(string[] args)
{
ClsEmployee4 obj1 = new ClsEmployee4();
ClsEmployee4 obj2 = new ClsEmployee4(obj1);
obj1.DisplayEmpData();
obj2.DisplayEmpData();
Console.Read();
}
}