Internal Class Employee
Internal Class Employee
{
public int EmpID { get; set; }
public string Name { get; set; }
public double Salary { get; set; }
}
using System; using System.Collections.Ge... by T V S Koushik
T V S Koushik
10:32 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Indexers
{
internal class EmployeeUtility
{
Employee[] employees = null;
public EmployeeUtility()
{
employees = new Employee[4];
employees[0] = new Employee() { EmpID = 101, Name = "Scott", Salary =
12356 };
employees[1] = new Employee() { EmpID = 102, Name = "Ram", Salary =
45645 };
employees[2] = new Employee() { EmpID = 103, Name = "Roger", Salary =
75675 };
employees[3] = new Employee() { EmpID = 104, Name = "Shyam", Salary =
23564 };
}
namespace Indexers
{
internal class Program
{
static void Main(string[] args)
{
EmployeeUtility utility = new EmployeeUtility();
utility.ViewEmployees();
string name = utility[102];
Console.WriteLine("Name is {0}", name);
utility[103] = "Koushik";
utility.ViewEmployees();
}
}
}