I've the code:
Map<String, String> map = new HashMap<String, String>;
Now in Eclipse is new HashMap<String, String> red underlined.
The Error: Syntax error on token(s), misplaced construct(s)
What does it mean and how can i fix it?
It should be
Map<String, String> map = new HashMap<String, String>(); //<-- add parentheses
Just add a ()! Map<String, String> map = new HashMap<String, String>();
With new HashMap, you call the HashMap.java. To initialize the HashMap, you should call the Constructer. Here with ().
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