i know this have been previously answered and i have read the answers in How to properly define an array of linked list in Java ? and How do I fix "The expression of type List needs unchecked conversion...'?
And i use this, as is recommended in the second answer of the second link
@SuppressWarnings("unchecked")
public void myMethod()
{
//...
}
Because in my code (example below) i need to use a static LinkedList[] so after reading the data i will have the size of the number i'll use in "Q = new LinkedList[size of data];". And i need the static LinkedList[] because i use it in many function
static LinkedList<Integer>[] Q;
@SuppressWarnings("unchecked")
static public void function(){
int r=3;
Q = new LinkedList[10];//this gives the warnning without "the unchecked"
Q[r]=new LinkedList<Integer>();
}
static public void function2(){
//using Q[r] for different r
}
It's still giving me the warning when i compile
memoria/bosques.java:3150: warning: [rawtypes] found raw type: LinkedList
Q = new LinkedList[10];
^
missing type arguments for generic class LinkedList<E>
where E is a type-variable:
E extends Object declared in class LinkedList
Compiling this in windows's eclipse works well, but in linux doesn't
Is there something i can do?
>``?
– Jean Logeart Jul 21 '15 at 18:17