摘要: 泛型一、泛型体验泛型是framework 2.0加入的一种特殊的算法重用机制,允许程序员在代码中将变量的类型先用类型占位符来替代,等到运行的时候在根据传入的类来替换。Demo1MyList类: 1 public class MyList 2 { 3 T[] arr; 4 public int count=0; 5 public MyList(int length) 6 { 7 arr = new T[length]; 8 } 9 public void Add(T t... 阅读全文
posted @ 2014-03-27 17:03 蜡笔小新111 阅读(689) 评论(0) 推荐(0) 编辑