- 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:

- GAE編程指南
- Moodle Administration Essentials
- 自己動(dòng)手實(shí)現(xiàn)Lua:虛擬機(jī)、編譯器和標(biāo)準(zhǔn)庫(kù)
- C#完全自學(xué)教程
- Practical DevOps
- INSTANT Weka How-to
- Java Fundamentals
- Data Science Algorithms in a Week
- OpenCV Android Programming By Example
- PowerDesigner 16 從入門(mén)到精通
- 深入理解Kafka:核心設(shè)計(jì)與實(shí)踐原理
- Raspberry Pi Blueprints
- Android應(yīng)用程序設(shè)計(jì)
- RESTful Web API Design with Node.js
- Building Scalable Apps with Redis and Node.js