Created
April 16, 2012 13:40
-
-
Save tnngo2/2398898 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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