title: Create a map with key=String and value=ArrayList<Double>
body: <p>I want to create a Map in a Java class, in which key is <code>String</code> and value is with type <code>ArrayList&lt;Double&gt;</code>. My requirement is that, if String equals some value, I could quickly pick up the corresponding list. All the lists are private variables in the same class.
  Could someone please tell me where in the following code is wrong?</p>
  
  <p>I got compilation error:</p>
  
  <pre><code>error: &lt;identifier&gt; expected METRICS_LIST_MAP.put("CPUUtilization", CPUUtilizationList);
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>private  ArrayList&lt;Double&gt; CPUUtilizationList;
  private  ArrayList&lt;Double&gt; DiskReadOpsList;
  private  ArrayList&lt;Double&gt; DiskWriteOpsList;
  private  ArrayList&lt;Double&gt; DiskReadBytesList;
  private  ArrayList&lt;Double&gt; DiskWriteBytesList;
  private  ArrayList&lt;Double&gt; NetworkInList;
  private  ArrayList&lt;Double&gt; NetworkOutList;
  
  Map&lt;String, ArrayList&lt;Double&gt;&gt; METRICS_LIST_MAP = new HashMap&lt;String, ArrayList&lt;Double&gt;&gt;();
  METRICS_LIST_MAP.put("CPUUtilization", CPUUtilizationList);
  METRICS_LIST_MAP.put("DiskReadOps", DiskReadOpsList);
  METRICS_LIST_MAP.put("DiskWriteOps", DiskWriteOpsList);
  METRICS_LIST_MAP.put("DiskReadBytes", DiskReadBytesList);
  METRICS_LIST_MAP.put("DiskWriteBytes", DiskWriteBytesList);
  METRICS_LIST_MAP.put("NetworkIn", NetworkInList); 
  METRICS_LIST_MAP.put("NetworkOut", NetworkOutList); 
  </code></pre>
  
  <p>Thanks!</p>