title: How to sort a Java Hashtable?
body: <p>I inserted some data into a Java Hashtable. If I read the data from the Hashtable it doesn't come back in the same order that I inserted it in. How do I get the ordered data from the Hashtable? </p>
  
  <p>I use the following code to get the values from the hashtable:</p>
  
  <pre><code>// Get a set of the entries
  Set set = hsUpdateValues.entrySet();
  // Get an iterator
  Iterator i = set.iterator();
  // Display elements
  while (i.hasNext()) {
      Map.Entry me = (Map.Entry) i.next();            
      System.out.print(
          "Key : " + me.getKey()
          + ", Value: " + me.getValue()
      );
  }
  </code></pre>