posted 12 years ago
You cannot store multiple values on the same key in a Map. If you add the second value, it overwrites the first value.Remember you may have to cast the elements retrieved from a Collection or Map in Java1.4, otherwise they are all of type java.lang.Object.
If you want to store multiple values in a Map, you can’t; … but you can use a List as a value. The technique is the same in Java1.4 as it is in Java7, only Java1.4 didn’t support generics.
If you look at the documentation for HashMap, it will probably say “since 1.2”, so you can tell which versions of Java support it. Every class ought to have a since field.