Abstract
In this chapter, you will learn two of the most useful features of Scala. These features exist in other languages that use the JVM, like Java or Kotlin—not with the same name but with the same concept behind the scenes.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Self types can also be used to discover at compile time what class a trait has been mixed into. See http://www.scala-lang.org/node/124.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
Cite this chapter
Pollak, D., Layka, V., Sacco, A. (2022). Traits and Enums. In: Beginning Scala 3. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7422-4_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-7422-4_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-7421-7
Online ISBN: 978-1-4842-7422-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)