Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 16, 2012 13:40
Show Gist options
  • Save tnngo2/2398898 to your computer and use it in GitHub Desktop.
Save tnngo2/2398898 to your computer and use it in GitHub Desktop.
class EmployeeDetails
{
public string[] empName = new string[2];
public string this[int index]
{
get { return empName[index]; }
set { empName[index] = value; }
}
static void Main(string[] args)
{
EmployeeDetails objEmp = new EmployeeDetails();
objEmp[0] = "Jack Aderson";
objEmp[1] = "Kate Jones";
Console.WriteLine("Employee Names: ");
for (int i = 0; i < 2; i++)
{
Console.Write(objEmp[i] + "\t");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment