Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

unchecked call: adding ints to linkedlist within an array

807607Nov 5 2006 — edited Nov 5 2006
Hi.

I have a array of linked lists defined like this:

private LinkedList[] graph = new LinkedList[100];

and I'm trying to add data to it like this:

graph[src].addLast(dest);

where src and dest are both ints. I get an error saying unchecked call when I try to compile. I've done some research and it appears I need to put <int> in a couple of places in the first line but I've tried everywhere and none of them seem to work!

Even when I ignore the warning, the program still fails, saying java.lang.nullPointerException... any ideas as to how I might fix these problems?

Thanks in advance for any help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2006
Added on Nov 5 2006
4 comments
238 views