java - ArrayList of Object as the Value of an EnumMap -


I was trying to do this for a while and this is driving me crazy. I have an Enemap where I have a value and some calculation in the form of a self-defined array of values. So something looks like:

  Private EnumMap & lt; MyEnum, list & lt; MyObj & gt; & Gt; Map = new anomap & lt; MyEnum, list & lt; MyObj & gt; & Gt; (MyEnum.class);   

This is giving me an error, not sure what's going on.

Edit: Yes, my anem is an enum square. My mistake, I should have said that which error is and where it happens. The error occurs when I do the following:

hand.products (myEnum.someEnum, new Arrayist);

I get an error: - Syntax error on Token, TypeErmentation 1 instead - Required Syntax Error on Token (",", "Required - Syntax Error on Token" New ", Delete this token

for:

  enum test {TEST0, TEST1;}   

You will use EnumMap in this way:

  EnumMap & lt; Test, List & gt; Object & gt; ; & Gt; Map = New Anim map & lt; Test, list & lt; Object & gt; (Test.class); map.put (Test.TEST0, new ArrayList & lt; CTO & gt; ());   

Hope clean use.

Comments