Java Convert Hashtable to Treemap

Here is an example for converting Hashtable to TreeMap by using constructor method. This is available for all collection and map classes.

Map<Integer, String> map = new TreeMap<Integer, String>(hashTable);
Category >> Collections  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
String foo = "bar";

  1. Shivam Singh on 2015-11-29

    Nice Example …. visit more java hashtable example

Leave a comment