title: Creating Dictionary in java?
body: <p>Everywhere on net, here is the way</p>
  
  <pre><code>Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  map.put("dog", "type of animal");
  System.out.println(map.get("dog"));
  </code></pre>
  
  <p>My point is should it not be Treemap considering dictionary has to be sorted? Agreed lookup wont be optimized in case of Treemap but considering sorting its best data structure</p>
  
  <p><strong>UPDATE :-</strong> one more requirement is return the lexicographically nearest word if the word searched is not present . I am not sure how to achieve it?</p>