Abstract
Inheritance is one of the most powerful features of Object-Orientation. It is the difference between an encapsulated language that provides an object-based model and an object-oriented language. Inheritance is also one of the main tools supporting reuse in an object-oriented language (although in Scala’s case Traits are also a major tool for reuse). You will use inheritance all the time without even realising it, indeed you have already been doing so every time you have benefited from the default implementation of toString (which is inherited through the class AnyRef by your classes if you do not explicitly extend any specific class).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Hunt, J. (2014). Classes, Inheritance and Abstraction. In: A Beginner's Guide to Scala, Object Orientation and Functional Programming. Springer, Cham. https://doi.org/10.1007/978-3-319-06776-6_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-06776-6_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-06775-9
Online ISBN: 978-3-319-06776-6
eBook Packages: Computer ScienceComputer Science (R0)