Both AnyVal and AnyRef are two subclasses of root class Any. These two represent two families of types in Scala: the first ones are object references, the latter are value classes.