解决方法
允许二进制兼容pre-generics字节码,因此允许新代码与旧代码接口.
从The Java Tutorials的Type Erasure页开始:
Type erasure enables Java applications
that use generics to maintain binary
compatibility with Java libraries and
applications that were created before
generics.[…]
Type erasure exists so that new code
may continue to interface with legacy
code.
有关相关问题,请查看C# vs Java generics.