这个变量应该有自己的类型,这样,它就可以与将遍历的列表、数组或集合中的每一个项兼容。
This variable should be typed so that it's compatible with each item in the list, array, or collection being iterated over.
集合框架引入了迭代器,用于遍历一个列表或者其他集合,从而优化了对一个集合中的元素进行迭代的过程。
The Collections framework introduced iterators for traversing a list or other collection, which optimizes the process of iterating through the elements in a collection.
现在可以很轻松地遍历这个集合并在一个列表中输出每个单元格的内容。
It's now quite easy to iterate over the collection and print the contents of each cell in a list.
That is basically saying, given some collection of data, I want to have again a looping mechanism, where now my process is, walk through this, the collection one element at a time. And for that, we have a particular construct, called a FOR loop.
现在我的过程就是,通过一个个访问这个集合中,的元素的方式,来遍历这个集合,为了达到这个目的,我们有一个特定的结构,成为FOR循环。
应用推荐