I would like to create an array (enum) of array (enum) of array (enum) of Strings. I don’t think it is possible to achieve this in Java, but I have heard about EnumMap.
public class Tricky {
public enum enumA { A1, A2, A3 };
public enum enumB { B1, B2, B3 };
public enum enumC { C1, C2, C3 };
HashMap<EnumMap<enumA, EnumMap<enumB, enumC>>,String> item
= new HashMap<EnumMap<enumA, EnumMap<enumB, enumC>>,String>();
public Tricky() {
// How do I put and get strings in my hash map?
}
}
The above code compiles, but how can I put and get string items in my map?
you might find this useful: