I have a HashMap with a key as an object of some class, and a value as another HashMap, who’s key is a String, and value is a Double:
HashMap<MyClass, HashMap<String, Double>> myHashMap;
I need a loop that will add keys (objects) and values (HashMaps) to this HashMap, but I cannot create a new HashMap variable in the loop as its ‘value’. Essentially, every MyClass object must have Strings with corresponding Doubles.
Is this possible? Does this even make any sense??
Example: