4.7. Reifiable Types
Because some type information is erased during compilation, not all types are available at run time. Types that are completely available at run time are known as reifiable types.
A type is reifiable if and only if one of the following holds:
• It refers to a non-generic class or interface type declaration.
• It is a parameterized type in which all type arguments are unbounded wildcards (§4.5.1).
• It is a raw type (§4.8).
• It is a primitive type (§4.2).
• It is an array type (§10.1) whose element type is reifiable.
• It is a nested type where, for each type T separated by a “.
”, T itself is reifiable.
For example, if a generic class X<T>
has a generic member class Y<U>
, then the type X<?>.Y<?>
is reifiable because X<?>
Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.