I’m trying to make an array of vectors like this:
Vector<String>[] wordList = new Vector[29];
for (int i = 0; i < wordList.length; i++) {
wordList[i] = new Vector<String>(100);
}
But Java warns me that “new Vector[29]” violates type safety. How do I get rid of the the warning?
Update: I’ve tried:
wordList = new Vector<String>[29];
Of course, but this generates the error: Cannot create a generic array of Vector
1 Answer