raw type

A generic type used without any type arguments, such as plain List, which turns off the compiler's type checks for it.

In more detail

Raw types exist only for compatibility with code written before Java 5. The compiler reports unchecked warnings when you use them, and wrong-type elements slip in and fail later with a ClassCastException. Keep them out of new code.

Example

List list = new ArrayList();  // raw: avoid

Related terms

Taught in

References

Certification courses