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


Win a copy of Head First Android this week in the Android forum!
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-Urankar
Ranch Hand

Joined: Nov 25, 2007
Posts: 136


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: 43282
    
  32
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

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

Joined: Oct 13, 2005
Posts: 43282
    
  32
You're welcome
 
Don't get me started about those stupid light bulbs.
 
subject: Worning: LinkedList is Raw datatype. References to generic type LinkedList<E> should be parametrized
 
jQuery in Action, 3rd edition