4.8. Raw Types

To facilitate interfacing with non-generic legacy code, it is possible to use as a type the erasure (§4.6) of a parameterized type (§4.5) or the erasure of an array type (§10.1) whose element type is a parameterized type. Such a type is called a raw type.

More precisely, a raw type is defined to be one of:

• The reference type that is formed by taking the name of a generic type declaration without an accompanying type argument list.

• An array type whose element type is a raw type.

• A non-static member type of a raw type R that is not inherited from a superclass or superinterface of R.

A non-generic class or interface type is not a raw type.

To see why a non-static type member of a raw type is considered raw, consider the following ...

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.