8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 84cf61d + 513854e commit 86e66b2Copy full SHA for 86e66b2
_tour/traits.md
@@ -50,8 +50,8 @@ class IntIterator(to: Int) extends Iterator[Int] {
50
51
52
val iterator = new IntIterator(10)
53
-iterator.next() // prints 0
54
-iterator.next() // prints 1
+println(iterator.next()) // prints 0
+println(iterator.next()) // prints 1
55
```
56
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.
57
0 commit comments