title: Get key from HashMap in Android by position or index
body: <p>I have:</p>
  
  <pre><code>public static HashMap&lt;String, String&gt; CHILD_NAME_DOB = new HashMap&lt;&gt;();
  </code></pre>
  
  <p>Suppose the values in <code>CHILD_NAME_DOB</code> are:</p>
  
  <pre><code>&lt;adam,15121990&gt;
  &lt;roy,01051995&gt;
  &lt;neha,05091992&gt;
  &lt;alisha,11051992&gt;
  </code></pre>
  
  <p>I am trying to fetch the last key element from <code>CHILD_NAME_DOB</code>. That is, I want to fetch key <code>alisha</code> from the example above to temporary <code>String name</code>.</p>
  
  <p>Also I want to know on how to fetch data by index. </p>
  
  <p>Eg.: if <code>int index = 2</code> , I want key <code>"Neha"</code> in <code>String name</code></p>
  
  <p>TIA.</p>
  
  <p>Edit: DateOfBirth value (value data in <code>CHILD_NAME_DOB</code>) is dynamic and is unknown. So <a href="https://stackoverflow.com/questions/8112975/get-key-from-a-hashmap-using-the-value">THIS LINK</a> is not what I want.</p>