multiple HashMap implementation
<p>I am trying to implement the use of two HashMaps and it seems to be more or less successful also.But now my problem is i want to update the value of a hashMap based on a check.ie if userId is already existing in the hash i need to update the timestamp corresponding to it...</p>

<p>Below given is my code.How can we accomplish the updation of values .Can that be done usiong setValue..?but how..?please help me friends..</p>

<pre><code>public static void main(String[] args)
{
  HashMap sessionTimeStampHash = new HashMap&lt;Long, Long&gt;(); //sessionID is the key and timeStamp is the value
  //userID is the key and sessionTimeStampHash object is the value
  HashMap&lt;String, HashMap&lt;Long, Long&gt;&gt; userSessionHash = new HashMap&lt;String, HashMap&lt;Long, Long&gt;&gt;();

  sessionTimeStampHash.put("sessionID", "timeStamp");
  userSessionHash.put("userID", sessionTimeStampHash);
  // System.out.println(userSessionHash);
  sessionTimeStampHash = new HashMap();

  sessionTimeStampHash.put("sessionID1", "timeStamp1");
  userSessionHash.put("userID1", sessionTimeStampHash);
  //  System.out.println(userSessionHash);
  sessionTimeStampHash = new HashMap();
  sessionTimeStampHash.put("sessionID2", "timeStamp2");
  userSessionHash.put("userID2", sessionTimeStampHash);
  //   System.out.println(userSessionHash);
  sessionTimeStampHash = new HashMap();
  sessionTimeStampHash.put("sessionID3", "timeStamp3");
  userSessionHash.put("userID3", sessionTimeStampHash);
  //   System.out.println(userSessionHash);


  for (Entry&lt;String, HashMap&lt;Long, Long&gt;&gt; entry : userSessionHash.entrySet())
  {
    String key = entry.getKey();
    System.out.println(key);
    System.out.println(entry.getValue());
    String userId = "userID3";
    if (key.equals(userId))
    {
      System.out.println("Check Successful");
      String TimeStamp = newTime;
      entry.setValue() // how can i change my timeStamp
    }
  }
}
</code></pre>
