Indexer C# with Example
using System; namespace CSharpClass{ class Employee { public string LastName; public string FirstName; public string CityOfBirth; } class UsingEmployee{ static void Main(String[] arg){ Employee emp1 = new Employee(); emp1.LastName = "Doe"; emp1.FirstName = "Jane"; emp1.CityOfBirth = "Dallas"; Console.WriteLine("Last Name: " + emp1.LastName); Console.WriteLine("First Name: " + emp1.FirstName); Console.WriteLine("City of Birth: " + emp1.CityOfBirth); } } }