Question sur tableau de LinkedList
Bonjour, voilà mon code pourquoi ne puis-je pas compiler?
j'ai une classe Triple (des triplets) et une classe Table:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public class Table {
final static int M = 5003;
LinkedList buckets[];
Table() {
this.buckets = new LinkedList[M];
for(int i=0; i<M; i++)
this.buckets[i] = new LinkedList<Triple>();
}
Triple find(int x, int y){
int i = 0;
while(!this.buckets[i].isEmpty())
{
Triple t = this.buckets[i].poll();
if(t.x == x && t.y == y)
return t;
}
return null;
} |
Java me dit qu'il ne reconnait pas this.buckets[i] comme un Triple, pourquoi? Comment pallier le problème?
Merci d'avance.