摘要: 1.性能:泛型的一个主要优点是性能,这是泛型比集合优越的原因。System.Collections.Generic名称空间中的List类不使用对象,而是在使用时定义类型。使用ArrayList类,在存储对象的时候,执行装箱操作,而在读取值的时候,进行拆箱。如:var list = new ArrayList();list.Add(44);//boxing-convert a value type to a reference typeint i1 = (int)list[0];//unboxing-convert a reference type to a value typeforeach( 阅读全文
posted @ 2014-01-18 17:13 阿樂 阅读(260) 评论(0) 推荐(0) 编辑