public static void main(String[] args) {
Map<String, List<String>> map = new LinkedHashMap<>();
//倒序遍历
ListIterator<Map.Entry<String, List<String>>> listIterator = new ArrayList<>(map.entrySet()).listIterator(map.size());
Map<String, List<String>> tmpMap = new LinkedHashMap<>();
while (listIterator.hasPrevious()) {
Map.Entry<String, List<String>> previous = listIterator.previous();
tmpMap.put(previous.getKey(), previous.getValue());
}
map = tmpMap;
}
标签:Map,Java,map,new,listIterator,倒序,previous From: https://www.cnblogs.com/lll-lilei/p/16720888.html