Just for completeness, if you want only immutable fields (recommended!)
case class A(name: String)
is the same as
class A(val name: String)
relatively immutable fields / properties. The keyword "case" automatically makes the arguments to the vals constructor, and also adds other goodies.
source
share