- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 130字
- 2021-07-02 23:54:23
Type casting
Type casting is a way to check the type of an instance and/or deal with that instance as if it is a different superclass or subclass from somewhere else in its class hierarchy. There are two types of operator to check and cast types as the following:
- Type check operator (is): This checks whether an instance is of a definite subclass type.
- Type cast operator (as and as?): A constant or variable of a definite class type may refer to an instance of a subclass under the hood. If this is the case, we can try to downcast it to the subclass type with as.
Type safety, type inference, annotation, aliases and type casting will be covered in detail in Chapter 3, Types and Type Casting.
推薦閱讀
- 數據庫應用實戰
- Building Computer Vision Projects with OpenCV 4 and C++
- Java Data Science Cookbook
- SQL Server入門經典
- Architects of Intelligence
- Visual Studio 2015 Cookbook(Second Edition)
- 大數據算法
- 深入淺出MySQL:數據庫開發、優化與管理維護(第2版)
- OracleDBA實戰攻略:運維管理、診斷優化、高可用與最佳實踐
- 重復數據刪除技術:面向大數據管理的縮減技術
- Solaris操作系統原理實驗教程
- 社交網站的數據挖掘與分析(原書第2版)
- Learn Selenium
- 工業大數據分析實踐
- 數據庫高效優化:架構、規范與SQL技巧