aspose file tools*
The moose likes Beginning Java and the fly likes Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized" Watch "Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized" New topic
Author

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

minal silimkar
Ranch Hand

Joined: Nov 25, 2007
Posts: 133


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.


Minal Silimkar
Mehar Simhadri
Greenhorn

Joined: Jan 25, 2009
Posts: 4
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

Joined: Oct 13, 2005
Posts: 40052
    
  28
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
Ranch Hand

Joined: Nov 25, 2007
Posts: 133
Thank you Mehar and Campbell for explaination and sending the refernces.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
You're welcome
 
Consider Paul's rocket mass heater.
 
subject: Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized