List<List<Integer>> vec2d = new LinkedList<List<Integer>>();
vec2d.add(Arrays.asList(new Integer[]{1,2,3}));
vec2d.add(Arrays.asList(new Integer[]{4,null,5}));
vec2d.add(null);
vec2d.add(Arrays.asList(new Integer[]{6,7,8,null}));
Iterable<List<Integer>> i = vec2d.iterate();
Iterable<Integer> j ;
while(i.hasNext()){
List<Integer> tlist = i.next();
if(tlist==null) continue;//有可能是null
j= tlist.iterate();
while(j.hasNext()){
Integer tinteger = j.next();
if(tinteger==null) continue;//有可能是null
print tinteger;
}
}
时间: 2024-11-03 03:25:42