Skip to content

Commit 10ce4db

Browse files
authored
Update 01_Iterable_and_Iterators.md
1 parent a0e4b8b commit 10ce4db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ch11/01_Iterable_and_Iterators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for (Iterator itr = coll.iterator() ; itr.hasNext() ; ) {
2424
}
2525
```
2626

27-
这个奇怪的声明是 `Java 5` 之前的首选语言,因为通过将itr的范围限制在循环体中,它消除了在其他地方意外使用它的可能性。 这段代码的工作原理是任何实现
27+
这个奇怪的声明是 `Java 5` 之前的首选语言,因为通过将 `itr` 的范围限制在循环体中,它消除了在其他地方意外使用它的可能性。 这段代码的工作原理是任何实现
2828
`Collection` 的类都有一个迭代器方法,该方法返回适合于该类对象的迭代器。 它已不再是已批准的惯用语,因为 `Java 5` 引入了更好的东西:`foreach` 语句,
2929
您在第I部分中遇到了。使用`foreach`,我们可以更简洁地编写前面的代码:
3030

0 commit comments

Comments
 (0)