building block in the language • order of execution is not important (useful for concurrency) • easy to translate mathematical functions into functional languages
key differences) • is good for modeling immutable data • requires the keywords case class, an identifier, and a parameter list (which may be empty) A case class:
Cats, and Snakes) and a function called 'speak'. • 'speak' should return the first two animals' speaking function. • For example, if you have Dog, there should be a function 'bark' that 'speak' returns. • For any other type, return "???"