Abstract
As well as providing switch-like functionality (that's more powerful than Java's version), pattern matching offers a rich set of "patterns" that can be used to match against. In this chapter, we'll look at the anatomy of patterns and talk through some examples, including literal, constructor, and type query patterns.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Toby Weston
About this chapter
Cite this chapter
Weston, T. (2018). Pattern Matching. In: Scala for Java Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3108-1_16
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3108-1_16
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)