8000 Merge pull request #1 from zhangchuanben/zhangchuanben-patch-1 · zhangchuanben/docs.scala-lang@dc92073 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc92073

Browse files
Merge pull request #1 from zhangchuanben/zhangchuanben-patch-1
Update traits.md
2 parents 8c7cd26 + 7b8c6c0 commit dc92073

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_zh-cn/tour/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class IntIterator(to: Int) extends Iterator[Int] {
5757

5858

5959
val iterator = new IntIterator(10)
60-
iterator.next() // returns 0
6160
iterator.next() // returns 1
61+
iterator.next() // returns 2
6262
```
6363
这个类 `IntIterator` 将参数 `to` 作为上限。它扩展了 `Iterator [Int]`,这意味着方法 `next` 必须返回一个Int。
6464

0 commit comments

Comments
 (0)
0