Case Classes

Download scala eBook


  • case class Foo() // Case classes with no parameters must have an empty list
  • case class Foo(a1: A1, ..., aN: AN) // Create a case class with fields a1 ... aN
  • case object Bar // Create a singleton case class

Related Examples


298 Contributors: 15
Wednesday, January 18, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook