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 fd3492c + dde4a8d commit dbf3472Copy full SHA for dbf3472
_tour/mixin-class-composition.md
@@ -72,11 +72,9 @@ This trait implements `foreach` by continually calling the provided function `f:
72
We would like to combine the functionality of `StringIterator` and `RichIterator` into a single class.
73
74
```tut
75
-object StringIteratorTest extends App {
76
- class RichStringIter extends StringIterator("Scala") with RichIterator
77
- val richStringIter = new RichStringIter
78
- richStringIter foreach println
79
-}
+class RichStringIter extends StringIterator("Scala") with RichIterator
+val richStringIter = new RichStringIter
+richStringIter foreach println
80
```
81
The new class `RichStringIter` has `StringIterator` as a superclass and `RichIterator` as a mixin.
82
0 commit comments