- 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.
推薦閱讀
- Python絕技:運(yùn)用Python成為頂級(jí)數(shù)據(jù)工程師
- 數(shù)據(jù)分析實(shí)戰(zhàn):基于EXCEL和SPSS系列工具的實(shí)踐
- 數(shù)據(jù)庫技術(shù)與應(yīng)用教程(Access)
- 數(shù)據(jù)庫基礎(chǔ)與應(yīng)用:Access 2010
- Word 2010中文版完全自學(xué)手冊(cè)
- 劍破冰山:Oracle開發(fā)藝術(shù)
- 虛擬化與云計(jì)算
- 大數(shù)據(jù):規(guī)劃、實(shí)施、運(yùn)維
- Sybase數(shù)據(jù)庫在UNIX、Windows上的實(shí)施和管理
- SQL優(yōu)化最佳實(shí)踐:構(gòu)建高效率Oracle數(shù)據(jù)庫的方法與技巧
- 數(shù)據(jù)庫應(yīng)用系統(tǒng)開發(fā)實(shí)例
- 數(shù)據(jù)修復(fù)技術(shù)與典型實(shí)例實(shí)戰(zhàn)詳解(第2版)
- 數(shù)據(jù)分析思維:產(chǎn)品經(jīng)理的成長(zhǎng)筆記
- 云工作時(shí)代:科技進(jìn)化必將帶來的新工作方式
- 大數(shù)據(jù)技術(shù)體系詳解:原理、架構(gòu)與實(shí)踐