I\'ve tried the following line:
Map map={new Character(\'r\'):Color.red,new Character(\'b\'):Color.black};
But Netb
To expand a little on Thomas's answer... Map is an interface, and must be instantiated through one of the associated concrete implementations (HashMap, TreeMap, or LinkedHashMap). It is still good practice; however, to declare your reference variable as the interface implementation rather than the specific concrete, as it provides future flexibility.
Regarding the code snippet though, I think you do still need the Key-value pairs defined in the assignment side of the declaration. So, I would change:
Map map = new HashMap<>() {{
to
Map map = new HashMap() {{