public class IndexTempte
    {
        public ArrayList nameList = new ArrayList();

        public string this[int index]
        {
            get
            {
                return nameList[index].ToString();
            }
            set { nameList.Add(value); }
        }
 
    }
 
        static void Main(string[] args)
        { 
            var list = new IndexTempte();
            list[0] = "China";
            list[1] = "USA";
            list[2] = "Germany";
  
            Console.WriteLine("name :{0}", list[2]);
 
        }

 

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2021-06-07
  • 2022-02-05
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-03
  • 2021-07-15
  • 2022-12-23
  • 2021-10-07
  • 2021-06-11
  • 2021-10-30
相关资源
相似解决方案