8000 Merge pull request #929 from salborrelli/patch-1 · soronpo/scala.github.com@86e66b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86e66b2

Browse files
Merge pull request scala#929 from salborrelli/patch-1
Fixed code to match comments
2 parents 84cf61d + 513854e commit 86e66b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_tour/traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class IntIterator(to: Int) extends Iterator[Int] {
5050
5151
5252
val iterator = new IntIterator(10)
53-
iterator.next() // prints 0
54-
iterator.next() // prints 1
53+
println(iterator.next()) // prints 0
54+
println(iterator.next()) // prints 1
5555
```
5656
This `IntIterator` class takes a parameter `to` as an upper bound. It `extends Iterator[Int]` which means that the `next` method must return an Int.
5757

0 commit comments

Comments
 (0)
0