ArrayList

1. .net framework 提供的用于数据存储和检索的专用类

2.是命名空间system.collections下的一部分

3.优势

3.1大小按照其中存储的数据来动态扩充与收缩

3.2声明时不需指定长度

3.3很方便的进行数据的 添加 插入 移除

4.代码

ArrayList a = new ArrayList();
//把数据加到末尾处
a.Add(“abc”);
a.Add(123);
//修改指定处数据
a[2]= 123//删除指定索引处数据
a.RemoveAt(0);
//删除内容为123的数据
a.Remove(123);
//指定索引插入数据
a.Insert (0,”ddd”);

 

posted @ 2022-06-05 23:00  驼七  阅读(27)  评论(0)    收藏  举报