I'm currently learning java generics and below is a list of types in java that is non-reifiable.
A type is not reifiable if it is one of the following:
• A type variable
(such as T
)
• A parameterized type with actual parameters
(such as List<Number>, ArrayList<String>, or Map<String, Integer>
)
• A parameterized type with a bound
(such as List<? extends Number> or Comparable<? super String>
)
I understand why parameterized type with actual parameter and parameterized type with bound is non-refieable, because after runtime erasure, the only type information left is List
, but why is type variable (such as T
) a non-reifiable type? I thought at runtime, after type erasure, T
would become Object
(given T
is an unbound type parameter), so the type information is available.
Is there something wrong with my understanding?