Cover page by Cay S. Horstmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 14. Pattern Matching and Case Classes

Topics in This Chapter image

14.1 A Better Switch — page 184

14.2 Guards — page 185

14.3 Variables in Patterns — page 185

14.4 Type Patterns — page 186

14.5 Matching Arrays, Lists, and Tuples — page 187

14.6 Extractors — page 188

14.7 Patterns in Variable Declarations — page 188

14.8 Patterns in for Expressions — page 189

14.9 Case Classes — page 189

14.10 The copy Method and Named Parameters — page 190

14.11 Infix Notation in case Clauses — page 191

14.12 Matching Nested Structures — page 192

14.13 Are Case Classes Evil? — page 192

14.14 Sealed Classes — page 193

14.15 Simulating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required