Re: hashmap having keys of different datatypes
Monday, February 23, 2004 01:51 PM
You can create a subclass of a HashMap and overwrite the containsKey() and get() methods calling toString() method in order to compare Strings instead of data types.
Another option is to use a TreeMap and set a Comparator. This comparator will help you to order and convert keys into a same data type.