java中map可以按插入顺序倒序输出么?
大家讲道理
大家讲道理 2017-04-18 10:50:17
0
1
793
public class Test {
    public static void main(String[] args) {
        LinkedHashMap<String,String>  a=new LinkedHashMap<String,String>();
        a.put("a", "1");
        a.put("b", "2");
        a.put("c", "3");
        for(String b:a.keySet()){
            System.out.println(b+"值为:"+a.get(b));
        }
        
    }
}

输出为
a值为:1
b值为:2
c值为:3
想要倒序输出怎么实现

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回覆(1)
迷茫

公開課測驗{

雷雷

}

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!