Scala LanguageCase Classes


Syntax

  • 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