Paul is right, however in Java 5, with autoboxing feature, a HashMap can take say a primitive key and a primitive value(e.g HashMap<int,float> , JVM in turn does the autoboxing behind the scenes for you.
...(e.g HashMap<int,float> , JVM in turn does the autoboxing behind the scenes for you.
Note, you can't write HashMap<int, float>, that will result in a compiler error. The things between the angle brackets cannot be primitive types. Hoewever, you can make a HashMap<Integer, Float> and Java 5 autoboxing: