I'm creating a game with two boards: http://imgur.com/nrCX5Ux
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
Type arguments cannot be primitive types. Use wrapper class alternative instead:
HashMap<String, Character>
Primitive type is not allowed in generic class, only class type is allowed. use like this.
HashMap<String, Character>
You cannot use primitive types in generics. Use Character
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With