码迷,mamicode.com
首页 > 其他好文 > 详细

集合遍历

时间:2017-02-16 22:59:12      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:循环   for   get   使用   删除   --   nbsp   list   index   

set集合遍历:

1.迭代器

2.增强for循环:只能遍历

 


List集合的遍历:

1. 迭代器

2. 增强for循环

3. 普通for循环 get(index) 和size()

 

 


注:增强for循环:只能遍历,不能删除,迭代器遍历可以删除,但必须使用迭代器,普通for循环可以删除,但必须记得i--;

集合遍历

标签:循环   for   get   使用   删除   --   nbsp   list   index   

原文地址:http://www.cnblogs.com/loaderman/p/6407449.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!