1.TreeMap TreeMap按照key进行排序。其它用法和HashMap相同 2.TreeMap vs HashMap 和Set类似,HashMap的速度通常都比TreeMap快,只有在需要排序的功能的时候,才使用TreeMap。