Chapter 10. Traits

Topics in This Chapter image

10.1 Why No Multiple Inheritance? — page 111

10.2 Traits as Interfaces — page 113

10.3 Traits with Concrete Implementations — page 114

10.4 Objects with Traits — page 115

10.5 Layered Traits — page 116

10.6 Overriding Abstract Methods in Traits — page 117

10.7 Traits for Rich Interfaces — page 118

10.8 Concrete Fields in Traits — page 118

10.9 Abstract Fields in Traits — page 119

10.10 Trait Construction Order — page 120

10.11 Initializing Trait Fields — page 122

10.12 Traits Extending Classes — page 123

10.13 Self Types — page 124

10.14 What Happens under the Hood — page ...

Get Scala for the Impatient now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.