Abstract
In this chapter we'll look at inheritance in Scala: how you create subclasses and override methods, the Scala equivalent of interfaces and abstract classes, and the mechanisms Scala offers for mixing in reusable behavior. We'll finish by discussing how to pick between all the options.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Since Scala 2.12, anonymous classes can be converted into Java SAMs automatically.
- 2.
- 3.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Toby Weston
About this chapter
Cite this chapter
Weston, T. (2018). Inheritance. In: Scala for Java Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3108-1_11
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3108-1_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3107-4
Online ISBN: 978-1-4842-3108-1
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)