
Scala's class hierarchy
Let's discuss Scala's class hierarchy, and also a few extra types that exist, such as bottom types in Scala. Scala has a unified type hierarchy, which means there's only one top-level class that's Any, and all other types extend directly or indirectly from this top-level type. It also means that any class that we define or a class pre-existing in Scala, has access to universal methods defined in the top-level class Any. Two variants of a relationship shown in the following figure are subtypes and view. The first one, subtypes depicts a relationship between two types, whereas the latter one shows that one type can be typecasted to another one. View relations are shown for value types, where a Char can be typecasted into Int.
The following figure shows the relationship between classes in Scala:
