Traits and Lists

Learn about traits used in place of interfaces and lists in Scala.

We'll cover the following

Traits as Mixins

Scala does not have interfaces. But it has Traits instead, which is somewhat like a combined Interface and Abstract-base-class in Java. However, unlike anything in Java, Traits can be applied to classes or instances of classes and multiple Traits can be used.

Here’s an example using a Trait:

Get hands-on with 1400+ tech skills courses.