This paper is mainly focus on the performance, safety and reusability of generics; it also introduced the using of generics in class, method, strut, interface and delegate, along with the implement of constraints and inherits. Then we compared the . NET generics with C++ template and Java generics. At last we summarized . NET generics, and came up with a prospect of its application in . NET programming.%介绍了.NET泛型机制的性能、安全和重用性,分析了泛型在类、方法、结构、接口、委托上的应用及其注意事项,并研究了泛型约束与继承这两项重要技术在泛型上的具体实现;将.NET泛型与C++模板、Java泛型进行了对比分析;对.NET泛型技术进行了总结,展望了泛型在.NET开发中的应用前景.
展开▼