Another consequence of erasure is that using casts or instanceof with generic type parameters doesn't make any sense. The following code will not improve the type safety of your code at all.
擦除的另一个后果是,对泛型类型参数是用强制类型转换或者instance of毫无意义。
With type erasure, generic types are used for type checking only; afterwards, they are replaced with their upper bound.
使用类型消除(type erasure),泛型类型仅用于类型检查;然后,用它们的上界替换它们。
With type erasure, generic types are used for type checking only; afterwards, they are replaced with their upper bound.
使用类型消除(type erasure),泛型类型仅用于类型检查;然后,用它们的上界替换它们。
应用推荐