遍历Map和遍历List方法
来源:互联网 发布:国际顶级域名干嘛的 编辑:程序博客网 时间:2024/06/05 08:01
遍历map方法
List<Map<String, Object>> columnList = ContentService.getColumnList(parent_column);
Iterator temp=columnList.iterator();
while(temp.hasNext()){
Map<String,Object> temp1=(Map)temp.next();
for(String str:temp1.keySet()){
System.out.println("key为"+str+"||| |||value为"+temp1.get(str));
}
List<Map<String, Object>> columnList = ContentService.getColumnList(parent_column);
Iterator temp=columnList.iterator();
while(temp.hasNext()){
Map<String,Object> temp1=(Map)temp.next();
for(String str:temp1.keySet()){
System.out.println("key为"+str+"||| |||value为"+temp1.get(str));
}
}
遍历List方法
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ArrayListDemo {
public static void main(String args[]){
List<String> list = new ArrayList<String>();
list.add("luojiahui");
list.add("luojiafeng");
//方法1
Iterator it1 = list.iterator();
while(it1.hasNext()){
System.out.println(it1.next());
}
//方法2 怪异!
for(Iterator it2 = list.iterator();it2.hasNext();){
System.out.println(it2.next());
}
//方法3
for(String tmp:list){
System.out.println(tmp);
}
//方法4
for(int i = 0;i < list.size(); i ++){
System.out.println(list.get(i));
}
}
}
0 0
- 遍历Map和遍历List方法
- 遍历Map和List
- list和map集合遍历方法
- List、Set和Map的遍历方法
- List、Map常用遍历方法
- 遍历List和Map集合,遍历数组
- Velocity遍历List和Map
- Velocity遍历List和Map
- Velocity遍历List和Map
- jstl遍历map和list
- jstl遍历Map和List
- Velocity遍历List和Map
- List 和 Map 的遍历
- java8 List和Map遍历
- map和list遍历测试和遍历map的四种方法
- 遍历List<map<>>以及map方法
- 遍历list,map,treemap的方法
- List、Set、Map的遍历方法
- 【最大流(EK)】hdu 3549 Flow Problem
- PAT1004
- Fragment使用
- 新年新的安排
- 项目总结—jQuery EasyUI-DataGrid动态加载表头
- 遍历Map和遍历List方法
- Window Server 2008 R2 +IIS7.5 部署WCF Rest问题
- queue
- 线段树。。。POJ 2777
- C#中给LABEL控件设置BACKGROUNDIMAGE属性
- CCSpriteFrameCache的用法
- 程序员须遵守的编程原则
- 《学习OpenCV》练习5-1
- Hibernate第五讲:Hibernate控制的事务