title: How do I insert values into a Map<K, V>?
body: <p>I am trying to create a map of strings to strings. Below is what I've tried but neither method works. What's wrong with it?</p>
  
  <pre><code>public class Data
  {
      private final Map&lt;String, String&gt; data = new HashMap&lt;&gt;();
      data["John"] = "Taxi Driver";
      data.put("John", "Taxi Driver");
  }
  </code></pre>