Generics can't use primitive types in the form of keywords.
Use
public HashMap buildMap(String letters)
{
HashMap checkSum = new HashMap();
for ( int i = 0; i < letters.length(); ++i )
{
checkSum.put(letters.charAt(i), primes[i]);
}
return checkSum;
}
Updated: With Java 7 and later, you can use the diamond operator.
HashMap checkSum = new HashMap<>();