摘要: 集合(ArrayList) 用的时候导入命名空间:using System.Collections; 加入数据时,不用考虑数据类型 拿出数据时多数情况需要里氏转换方法:用ArrayList的方法添加内容,定义一个person类有一个打招呼方法,如果需要用到person类的内容,里氏转换并调用打招呼方法,否则,输出添加的内容代码: ArrayList arrayList = new ArrayList();//类的初始化 arrayList.Add("小蚊子");//往arrayList中添加 arrayList.Add(12);... 阅读全文
posted @ 2012-11-19 08:03 卡西法儿 阅读(379) 评论(0) 推荐(1)