Java Reference
In-Depth Information
erics code must be able to work with generics, and generic code must be able to work with
pre-generics code.
To handle the transition to generics, Java allows a generic class to be used without any
type arguments. This creates a raw type for the class. This raw type is compatible with leg-
acy code, which has no knowledge of generics. The main drawback to using the raw type
is that the type safety of generics is lost.
Here is an example that shows a raw type in action:
Search WWH ::




Custom Search