pattern matching and case classes
Post on 13-Dec-2014
91 Views
Preview:
DESCRIPTION
TRANSCRIPT
Functional GroupCase class and Pattern Matcher
How work the case classes?
• Parameters list of case class are added as members automatically
• Automatically add methods for equals, hashCode and to String
• All attributes are passed by constructor method have public acesss
Pattern Matcher
Scala - Match
Match – Undefined type
What is the “_”?
Matching on type
Case class + Pattern Matching
Function without Pattern Matching
With Pattern Matching
Thanks!!
top related