While trying to declare the HashMap normally the code is written as
Map<K,V> m = new HashMap<>();
If I try to create a hash map by the below mentioned code :
HashMap<K,V> m = new HashMap<>();
What is the difference between the two declarations and which one should be preferred ?