What is the error in the following code? using System; class Employee { private string[]name = new string[10]; public static string this[int index] { get { return name[index]; } set { name[index] = value; } } } class Test { public static void Main() { Employee emp = new Employee(); emp[0] = Sachin; emp[1] = Rohit; emp[2] = Amit; Console.WriteLine(Emploees are:); for (int i = 0; i < 3;i++) { Console.WriteLine(emp[i]); } Console.ReadLine(); } }
Reveal answer
Fill a bubble to check yourself