- Learning Scala Programming
- Vikash Sharma
- 142字
- 2021-06-30 19:07:50
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:

- OpenShift開發指南(原書第2版)
- Java系統分析與架構設計
- 編程卓越之道(卷3):軟件工程化
- 零基礎學Scratch少兒編程:小學課本中的Scratch創意編程
- C語言程序設計
- AutoCAD VBA參數化繪圖程序開發與實戰編碼
- 零基礎學單片機C語言程序設計
- VMware虛擬化技術
- Angular開發入門與實戰
- Python High Performance Programming
- Microsoft Azure Storage Essentials
- Python項目實戰從入門到精通
- Spring Security Essentials
- HTML5權威指南
- Spring+Spring MVC+MyBatis從零開始學