3 ms·
> In OCaml, objects can contain mutable values but they must be explicitly marked as such. Or in Scala, you have to mark object's variables either as `val` (im
by sampo 13y ago
> In OCaml, objects can contain mutable values but they must be explicitly marked as such.
Or in Scala, you have to mark object's variables either as `val` (immutable) or `var` (mutable).
Like /u/Fishkins said, the Scala course in Coursera gives some examples of the use of immutable objects ( https://www.coursera.org/course/progfun https://www.coursera.org/course/progfun ). I am sure they are used in a lot of places in Scala code, not only in Odersky's course.