随笔分类 -  C#---泛型

摘要:三,关于泛型集合,能用则用 用Array,ArrayList,Dictionary等存储对象集合,面临的不只是拆装箱性能损耗的问题。从系统架构角度讲, 所有对象对象都应该是强类型的。为了解决这个问题,从.Net2开始,便有了泛型。看如下代码:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->publicclassMobile{privateArrayListfriends=newArrayList();//这里用ArrayList便不足取pub 阅读全文
posted @ 2011-07-22 10:40 meifage2 阅读(312) 评论(0) 推荐(0)