using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp1
{
// I am using structure to define values type set
public struct Employee
{
public int EmpId;
public string FirstName;
public string LastName;
// Here i am checking whether parameter less constructor will work
static Employee()
{
Console.WriteLine("First Object Created");
}
// Here i am using one more constructor for initializing it with some values later on
public void Employee(int number, string firsname, string lasname)
{
id = number;
FirstName = firsname;
LastName = lasname;
}
}
// Here i am using the parameterize constructor to assign values mentioned before in the //structure
class Program {
Employee emp1 = new Employee(23,"shiva","shankar");
}
}
// Error i am getting is Employee structure doesnt contain constructor that takes 3 args // The name id doesnt exist in current context //Employee : member names cannot be same as their enclosing type