集合 ArrayList

集合一般在 System.Collection命名空间下

因为数组长度一般是固定的,所以要使用集合

ArrayList al = new ArrayList();
al.Add(5);
al.Add("hello");
al.Remove(5);

每个元素都被当成object。类型不安全。


首页 我的博客
粤ICP备17103704号