Hashmap和Hashtable 都不是有序的。TreeMap和LinkedHashmap都是有序的。
TreeMap实现有序的原理:
LinkedHashmap实现有序的原理:
不过,话说一个map实现有序有什么用?