公共靜態void main(String[] args) {
LinkedHashMap & ltString,String & gtlinked hashmap = new linked hashmap & lt;String,String & gt();
linkedhashmap.put("1 "," a ");
linkedhashmap.put("2 "," b ");
linkedhashmap.put("3 "," c ");
linkedhashmap.put("4 "," d ");
ListIterator & lt地圖。Entry & ltString,String & gt& gtI =新數組列表& lt地圖。Entry & ltString,String & gt& gt(linkedhashmap.entrySet())。list iterator(linked hashmap . size());
while(i.hasPrevious()) {
地圖。Entry & ltString,String & gtentry = I . previous();
system . out . println(entry . getkey()+":"+entry . getvalue());
}
}
結果: