Entry tags:
just learned
case classes in Scala have a method
Neat, nice, nifty!
Now the question is: why would one need it, in case the class is immutable?!
This is why
copy
Neat, nice, nifty!
Now the question is: why would one need it, in case the class is immutable?!
This is why
case class Person(first: String, second: String) val p1 = Person("John", "Waters") val p2 = p1.copy(first="James")