Mixins are traits which are used to compose a class.
Class D
has a superclass B
and a mixin C
. Classes can only have one superclass but many mixins (using the keywords extends
and with
respectively). The mixins and the superclass may have the same supertype.
This is a companion discussion topic for the original entry at http://docs.scala-lang.org//tutorials/tour/mixin-class-composition.html.html