GenericsExamples icon indicating copy to clipboard operation
GenericsExamples copied to clipboard

Replace usage of raw types with explicit type arguments

Open deduper opened this issue 3 years ago • 0 comments

Your "Generics: How They Work and Why They Are Important" article says:

"...Raw types...it is not a good idea to use them..."

But then you use them in your own code:

List<GenericContainer> genericList = new ArrayList<GenericContainer>();

In my opinion, the following usage would, not only be better style, it would also be more type safe (aka, less error-prone):

List<GenericContainer<String>> genericList = ...;

deduper avatar Jan 26 '22 13:01 deduper