title: How do I create a dictionary in Java?
body: <p>I am curious as to how to create a dictionary in Java. I know that Python had a dictionary setup similar to <code>dictionary = {"key": "something"}</code>.
  I know there are other ways to do this in Java, such as creating two synchronized lists and using the same position in each list to mimic a dictionary.</p>
  
  <pre><code>ArrayList&lt;Object&gt; keys = new ArrayList&lt;Object&gt;();
  ArrayList&lt;Object&gt; values = new ArrayList&lt;Object&gt;();
  public void add(Object key, Object value){
      keys.add(key);
      values.add(value);
  }
  // And a subsequent return function
  public Object getValue(Object key) {
      return values.get(keys.indexOf(key));
  }
  </code></pre>
  
  <p>However, this screams to me bad programming. Is there a simpler syntax to do it with a single statement? Most questions already asked about the subject are closed and, consequently, of little help.</p>