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));
}
}
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));
}
}
相关文章推荐
- 关于JDK,JRE,JVM写的最好的文章。
- fragment的生命周期
- android 友盟分享 之微信分享一直卡在正在进入微信,问题
- 各类 HTTP 返回状态代码详解
- spring源码分析(1) 之 DispatcherServlet:
- 图
- POJ--1258--
- TCP沾包解包(3)
- iOS ImageView 的填充模式
- java.text.MessageFormat 专题
- python基础(1)
- JVM虚拟机基础
- Linux下用python给某个目录下的wav文件创建相应的文本文件(标注文件)
- centos import MySQLdb 报错!
- SharedPreferences优化总结
- [翻译]Event Handler Description 事件处理描述
- hdu 1595 find the longest of the shortest(迪杰斯特拉,减去一条边,求最大最短路)
- 思维题目(发现最近我的思维是越来越差了)
- android开发命名规范
- OBS外放声音重采样,用sdl播放