public static void Main() { IndexerCreation ic = new IndexerCreation(); ic[0] = "Abhijeet"; ic[1] = "Aman"; ic[2] = "Amit"; ic[3] = "Aniket"; Console.Write("Printing values stored in objects used as arrays\n"); Console.WriteLine(ic[0] + "\n" + ic[1] + "\n" + ic[2] + "\n" + ic[3]); }
public static void Main() { IndexerCreation ic = new IndexerCreation(); ic[0] = "C"; ic[1] = "CPP"; ic[2] = "CSHARP"; Console.Write("Printing values stored in objects used as arrays\n"); Console.WriteLine("First value = {0}", ic[0]); Console.WriteLine("Second value = {0}", ic[1]); Console.WriteLine("Third value = {0}", ic[2]); }