Another tour of Scala

 
 
 
 

Unified Types

Viewing old version b2da5366a2dc15efc539de30ac757ee644fb4234; 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:57:35 PM by davec

blog comments powered by Disqus