26. Don’t Use Raw Types
Since Java 5, generics were introduced. However, before that Collections (e.g. List) where still part of the language.
With generics it became possible to declare, inside the diamond declaration (), which type a List would be working with. Without a diamond declaration, it would be classified as a raw type.
Because of backwards compatibility these raw types where not removed after java 5’s release. However, regardless of them being part of the language, they should never be used.
Raw types enable the possibility to add unintended objects to the List, which will throw an exception at runtime.