I need to create and use an array of Deques, something like the following
Deque<Point>[] saved = new LinkedList<Point>[12];
This code results in an error because Java doesn't allow you to create generic arrays of Deques. Is there a way to set up the array of Deques so I can access each individual Deque when I need to?
I also tried:
Deque<Point>[] saved;
//....
for(int i = 0;i<12;i++)
{
saved[i] = new LinkedList<Point>;
}
which returns a NullPointerException. How can I create this array?
Deque<Point>[] saved = new Deque[12];....