Mega Code Archive

 
Categories / Java Tutorial / Collections
 

TreeMap Class

A TreeMap is a map that maintains its keys ordered within a balanced, red-black tree. Creating a TreeMap public TreeMap(): creates an empty TreeMap public TreeMap(Map map): the standard copy constructor public TreeMap(Comparator comp): defines a custom sort order public TreeMap(SortedMap map): accepts a SortedMap for an optimized copy constructor