We have mentioned a number of types in Scala’s type hierarchy already. Let’s look at the general structure of the hierarchy, as illustrated in Figure 7-1.
Figure 7-1. Scala’s type hierarchy
Tables 7-2 and 7-3 discuss the types shown in Figure 7-1, as well as some other important types that aren’t shown. Some details are omitted for clarity. When the underlying “runtime” is discussed, the points made apply equally to the JVM and the .NET CLR, except where noted.
Table 7-2. Any, AnyVal, and AnyRef
The root of the hierarchy. Defines a few
final methods like
The parent of all value types,
which correspond to the primitive types on
the runtime platform, plus
The parent of all reference
types, including all