public static void Main()
private string department;
public employee(string name, string department, int salary, string location)
this.department = department;
this.location = location;
public string getDepartment
public string getLocation
public static void Main()
List<employee> employeeList = new List<employee>();
employeeList.Add(new employee("John", "Finance", 10,000, "Udaipur"));
employeeList.Add(new employee("Mike", 23, "Engineer"));
employeeList.Add(new employee("Alex", 29, "Manager"));
employeeList.Add(new employee("Smith", 29, "Intern"));
foreach(var item in employeeList)
Console.WriteLine("Name: {0}, Department: {1}, Salary: {2}, Location: {3}", item.getName,item.getDepartment,item.getSalary, item.getLocation);