[beginning-scala-programming] Case Class


case class

case class Employee(name: String, office: String, role: String)

val fred = Employee("Fred", "Anchorage", "Salesman")
// fred: Employee = Employee(Fred,Anchorage,Salesman)
val joe = fred.copy(name="Joe")
// joe: Employee = Employee(Joe,Anchorage,Salesman)

참고 : scala-exercies

참고 : 스칼라스쿨