• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized

 
Minal Silimkar-Urankar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This line shows warning in eclipse.

LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized

In command prompt, it does not show any warning.

After adding object, it removes error.

 
Mehar Simhadri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
You have to use any collection with parameters

look at this http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html for more information


-Mehar
 
Campbell Ritchie
Sheriff
Posts: 51349
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right that you ought to use Lists with parameters, but it is not absolutely compulsory. That is why you receive a warning, not a compiler error, for missing out the parameters.
Another nice reference about generics is here, in the Java Tutorials, and you can find another useful resource by googling for "Angelika Langer Java generics FAQ."
 
Minal Silimkar-Urankar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mehar and Campbell for explaination and sending the refernces.
 
Campbell Ritchie
Sheriff
Posts: 51349
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic