Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of raw types with explicit type arguments #1

Open
deduper opened this issue Jan 26, 2022 · 0 comments
Open

Replace usage of raw types with explicit type arguments #1

deduper opened this issue Jan 26, 2022 · 0 comments

Comments

@deduper
Copy link

deduper commented Jan 26, 2022

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 = ...;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant