摘要:
泛型 一、什么是泛型? 通过泛型可以定义类型安全类,而不会损害类型安全、性能或工作效率 二、实例化泛型 1、可以使用任何类型来声明和实例化 2、申明和实例话都必须用一个特定的类型来代替一般类型T 3、例子: //原来写法 Public class Stack { object[] m_Items; public void Push(object item) {...} public object Pop() {...} } Stack stack = new Stack(); stack.Push(1); int number = (... 阅读全文