Skip to Content
Scala Reactive Programming
book

Scala Reactive Programming

by Rambabu Posa
February 2018
Intermediate to advanced
552 pages
13h 46m
English
Packt Publishing
Content preview from Scala Reactive Programming

Benefits of Scala Case class

By default, the Scala compiler adds the following benefits to a Case class for free:

  • The toString, hashCode, and equals methods. When we use the case keyword, the Scala compiler adds these methods for free to avoid boilerplate code.
  • A companion object with apply and unapply methods, that's why there is no need to use new keywords to create instances of a Case classes copy method.
  • Easy to use in pattern matching. It is immutable because, by default, its constructor parameters are val.
In Scala, by default, case class and case objects are serializable.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Scala Programming Projects

Scala Programming Projects

Mikael Valot, Nicolas Jorand
Learning Scala

Learning Scala

Jason Swartz
Functional Programming in Scala

Functional Programming in Scala

Runar Bjarnason, Paul Chiusano

Publisher Resources

ISBN: 9781787288645Supplemental Content