Is this possible? : HashMap<String, char>
char, hashmap, java, string
Solution
Type arguments cannot be primitive types. Use wrapper class alternative instead:
HashMap<String, Character>
Problem
I'm creating a game with two boards: https://i.stack.imgur.com/cpWlO.jpg I want to link the "A" to the ".". Both are string Arrays. I want to use this: ``` indexesOfBoard.put("A", ((morris.START[0].charAt(0)))); ``` But then I get an error like: ``` The method put(String, String) in the type HashMap<String,String> is not applicable for the arguments (String, char) ``` And if I change the HashMap to `< String, char>` I'll get: ``` Syntax error on token "char", Dimensions expected after this token ```