Hi Guys I have a question about HashMap declaration in Java. I'd like to know what is the difference between:
HashMap<String,Integer> map = new HashMap<>();
and
HashMap<String,Integer> map = new HashMap<String,Integer>();
Most coding websites teach the second one. However, the first one works perfectly fine. Is there a reason we should use second one?