using System;
      using System.Collections;
      //csc indexers_arrayList_1.cs
      namespace ex_indexer_arraylist
      {
      public class test_indexers
      {
      //private int n3= 0 ; 
      private ArrayList str_a = new ArrayList();
      //private double[] dd = new double[10];
      // index constructor indexers 
      public test_indexers()
      {
      
      Console.WriteLine(" Constructor no paramater " );
      }
      public object this[int n1 ]
      {
      get
      {
      Console.WriteLine("get array Index : {0}", n1);
      return str_a[n1];
      }
      set
      {
      str_a.Add(value);
      Console.WriteLine("\tset value {0}",str_a[n1] = value);
      }
      }
      }
      class test {
      static void Main()
      {
      //int x = 10;
      Console.WriteLine(" ---Constructor ----UnderConstruction " );
      test_indexers str = new test_indexers();
      test_indexers str1 = new test_indexers();
      Console.WriteLine(" ---Constructor ----Construction- Completed " );
      Console.WriteLine(" " );
      str[0] = "Hello, World";
      System.Console.WriteLine(str[0]);
      Console.ReadLine();
      System.Console.WriteLine("---view like array--");
      str1[0] = "Hello";
      str1[1]= "world";
      System.Console.WriteLine("{0}{1}{2}",str1[0],"-",str1[1]);
      Console.ReadLine();
      }
      }
      }