This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Linked Lists (Java Collections framework) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Linked Lists (Java Collections framework)" Watch "Linked Lists (Java Collections framework)" New topic

Linked Lists (Java Collections framework)

Asa Fernando

Joined: Dec 05, 2005
Posts: 1
When I write a simple java program to add elements to the java.util.LinkedList; class using add(0,i1) I get the following warning.

C:\Asanak\Project>javac -Xlint:unchecked warning: [unchecked] unchecked call to add(int,E) as a member of
the raw type java.util.LinkedList
1 warning

Can someone pls help me out. Thanks in advance.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183


Welcome to JavaRanch!

You're using a Java 5 compiler, and Java 5 has generics. Basically, Java now lets you specify what kind of objects that LinkedList can hold, and the warning is telling you that you're not taking advantage of that feature. Read the article for more info.

By the way, I deleted a copy of this message from the Java in General (Intermediate) forum. For an explanation, please read this.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Linked Lists (Java Collections framework)
Similar Threads
cannot create dll with JNI
collections doubt
I am close to submit - eliminate a warning message
access object in a vector
Error can't find class