• Gustavo Adolfo Lopez 7
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

So, I tried to use a map with an Enum object (which I am told I can use as a datatype in the documentation), but it does not work.

 

 

Declaration in the class definition:

 

public enum Season {WINTER, SPRING}

 

Definition of Map in the constructor:

 

 

Map<Season,String> heatMap = new Map<Season,String> ();

 

 Error:

 

 

 

 

 

Error: Compile Error: Map by CustomCon.Season not allowed at line 27 column 37