3 ms·
Scala has value types, and you can even define your own by extending AnyVal and following some tricky rules. It's just that Scala doesn't make you treat them di
by hibikir 11y ago
Scala has value types, and you can even define your own by extending AnyVal and following some tricky rules. It's just that Scala doesn't make you treat them differently than any other types, and they can still be magically autoboxed, just like in Java, if they get in a collection that isn't specialized to handle them.
The Scaladocs lead to more detailed explanation:
http://www.scala-lang.org/api/current/index.html#scala.AnyVal http://www.scala-lang.org/api/current/index.html#scala.AnyVa...