July 2017
Intermediate to advanced
796 pages
18h 55m
English
A case class is an instantiable class that includes several automatically generated methods. It also includes an automatically generated companion object with its own automatically generated methods. The basic syntax of a case class in Scala is as follows:
case class <identifier> ([var] <identifier>: <type>[, ... ])[extends <identifier>(<input parameters>)] [{ fields and methods }]
A case class can be pattern matched, and comes with the following methods already implemented the method hashCode (location/scope is a class), apply (location/scope is an object), copy (location/scope is a class), equals (location/scope is a class), toString (location/scope is a class), and unapply (location/scope is an object).
Like a plain ...
Read now
Unlock full access