What changes must be done in a following class to get code to compile?
 
    public class Foo { 
         private int[] a = new int[10]; 
         private Dictionary<string, int> b;
         private int[] c = new int[100]; 

         public int this[int i] {         // 1 
             get { return a[i]; } 
             set { a[i] = value; }  
       } 

       public int this[string id] {   // 2 
            get { return b[id]; } 
            set { b[id] = value; } 
       } 

       public int this[int i, int j] { // 3
          get { return c[i*10 + j]; } 
          set { c[i*10 + j] = value; } 
      } 
  }
 

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes