Cover page by Cay S. Horstmann

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required