making an array of type ArrayList<String>
The section of code below is used to radix sort a list of 5-letter Strings. Its saying the array declaration line is unchecked or unsafe, requiring type <String> to be specified on the right hand side of the =. If I do that, it throws an error and won't compile. It works the way I have it pasted, but it throws the error and I would rather it not. Any ideas?
sorts.java:405: warning: [unchecked] unchecked conversion
found: java.util.ArrayList[]
required: java.util.ArrayList<java.lang.String>[]
ArrayList<String>[] radixStringSort =new ArrayList[26];
^
1 warning
privatestaticvoid radixSort()
{
compares = 0;
swaps = 0;
sortArray = words.toArray (new String [ words.size() ] );
ArrayList<String>[] radixStringSort =new ArrayList[26];
int letter;
for (int y = 0; y < 26; y++ )
{
radixStringSort[y] =new ArrayList<String>();
}
System.out.print ("Radix\t\t" );
startTime();
for (int x = 4; x >= 0; x-- )
{
for (int y = 0; y < 26; y++ )
radixStringSort[y].clear();
for (int y = 0; y < sortArray.length; y++ )
{
compares++;
letter = Character.getNumericValue
( sortArray[y].charAt(x) ) - 10;
radixStringSort[letter].add ( sortArray[y] );
}
for (int y = 0; y < 26; y++ )
radixStringSort[y].trimToSize();
int placeholder = 0;
for (int y = 0; y < 26; y++ )
for (int z = 0; z < radixStringSort[y].size(); z++ )
{
swaps++;
sortArray [ placeholder++ ] = radixStringSort[y].get(z);
}
}
msTaken = endTime();
if ( writeFiles );
printSortedToFile ("radix.txt" );
System.out.print ( msTaken +" ms\t\t" + compares +"\t\t\t" + swaps );
if ( checkSorted )
System.out.print ("\t\t " + isSortArraySorted() );
System.out.print ("\n" );
}

