您的位置:首页 > 其它

map转list

2016-05-26 13:45 323 查看
      public static void testMapVoid() {  

           Map<String,String> map = new HashMap<String,String>();  

           map.put("a", "a1");  

           map.put("b", "b1");  

           map.put("c", "c1");  

           List<String> listKey = new ArrayList<String>();  

           List<String> listValue = new ArrayList<String>();

           for(Map.Entry<String,String> e : map.entrySet()){

               listKey.add(e.getKey());

               listValue.add(e.getValue());

           }

           

             

           for(int i = 0 ;i < listKey.size(); i++){  

               System.out.print("Key :"+listKey.get(i));  

               System.out.println(",Value :"+listValue.get(i));  

           }  

       }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: