首页 > 其他 > 详细

便利Map集合

时间:2018-09-14 22:19:18      阅读:152      评论:0      收藏:0      [点我收藏+]

用KeySet()方法;

Map<Integer, String> map = new HashMap<Integer, String>();
        map.put(01, "a");
        map.put(02, "b");
        map.put(03, "c");
        map.put(04, "d");
        Set set = map.keySet();
        ArrayList<Integer> list = new  ArrayList<Integer>(set);
        for (int i = 0; i < list.size(); i++) {
            int s = list.get(i);
            System.out.println(s);
            Object o = map.get(s);
            System.out.println(o);
            System.out.println("==");

 

便利Map集合

原文:https://www.cnblogs.com/wzs9/p/9649096.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!