score:2

as the tour of scala or the scala 3 book says

when you create a case class with parameters, the parameters are public vals.

therefore, in

case class person(name: string, age: int)

both name and age will be public, unlike in an ordinary class.


Related Query

More Query from same tag