泛型,是在J2SE5.0版本中推出的,它是对类型系统(type system)的一种增强,泛型能够使类或者方法操作各种各样类型的对象同时能够保证编译时期(compile-time)类型的安全。
它向集合框架中添加了编译时期的安全性因此阻止了冗余的类型转换。
Introduced in J2SE 5.0, this long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting.
Java泛型(Generics)
最新推荐文章于 2023-11-08 21:45:09 发布