I am new to java and came across the following usage for hashmaps :
public static HashMap< String, Integer > Table1;
....
Table1 = new HashMap< String, Integer > ();
.....
public Map<String, Integer> Table2 = new HashMap<String, Integer>();
My question is are the above statement equivalent ? I see Map<String, Integer>
is used for Table2. Is HashMap< String, Integer > Table1
and Map<String, Integer> Table2
same programing construct ? Can they be used interchangeably?