What is the difference between a case and a normal class?
You can do pattern matching on its name and its constructor parameters (this is usually the important point). A normal class can only be matched by name – any condition on its members have to be in the guard clause. You can construct instances of these classes without using the new keyword. All constructor arguments are accessible from outside using automatically generated accessor functions. The toString method is automatically redefined to print the name of the case class and all its arguments. The equals method is automatically redefined to compare two instances of the same case class structurally rather than by identity. The hashCode method is automatically redefined to give equal values for instances that are the same when compared with equals. Since Scala 2.7.0 a case class can extend a case class. Case classes are commonly used to create user-defined value types – data structures, if you will. Some obvious examples might be complex numbers or street addresses. Objects of a value