Java Generics 简明教程

Discuss Java Generics

Java 泛型方法和泛型类使程序员能够使用单个方法声明指定一组相关方法,或使用单个类声明指定一组相关类型。泛型还提供编译时类型安全性,允许程序员在编译时捕获无效类型。本参考将引导您使用 Java 泛型采用简单实用的方法。

Java Generic methods and generic classes enable programmers to specify, with a single method declaration, a set of related methods, or with a single class declaration, a set of related types, respectively. Generics also provide compile-time type safety that allows programmers to catch invalid types at compile time. This reference will take you through simple and practical methods using Java Generics.