Blog Archive for April 30, 2015

Sorting Hashtable Keys in Java

April 30, 2015

I wanted to sort the keys in a hashtable in Java, this can be done with the following code:

 private void process(Hashtable<String, String> pColumnsHash)
  {
    List<String> lColumnNames = new ArrayList<String>(pColumnsHash.keySet());
    Collections.sort …