Another tour of Scala

 
 
 
 

Unified Types

Viewing old version 045edcb5e57fa68887850c7b9a232233e14c05b6; View Current

All Scala values are objects; there is no formal “primitive” type as there is in Java. However, there is a distinction in the main object tree.

Every object is a subtype of Any, however in practice, most objects will be a subtype of AnyRef. AnyVal is a superclass for the types that, in Java, are considered “primitive” (that being things like int, byte, and float). Further, all classes implicitly extend scala.ScalaObject (which is a Mixins(trait)).


Last Updated 07/20/2009 at 07:58:45 PM by davec

blog comments powered by Disqus