- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 78字
- 2021-07-02 23:54:23
Type inference
Swift provides type inference. Swift infers the type of a variable, constant, or expression automatically, so we do not need to specify the types while defining them. Let's look at the following example:
let pi = 3.14159
var primeNumber = 691
let name = "my name"
In this example, Swift infers pi as Double, primeNumber as Int, and name as String. If we need special types such as Int64, we will need to annotate the type.
推薦閱讀
- 數據庫原理及應用教程(第4版)(微課版)
- 數據庫基礎與應用:Access 2010
- Word 2010中文版完全自學手冊
- 計算機信息技術基礎實驗與習題
- 數據庫系統原理及應用教程(第4版)
- UDK iOS Game Development Beginner's Guide
- 大數據治理與安全:從理論到開源實踐
- 聯動Oracle:設計思想、架構實現與AWR報告
- Unity 2018 By Example(Second Edition)
- 中國云存儲發展報告
- 企業大數據處理:Spark、Druid、Flume與Kafka應用實踐
- Deep Learning with R for Beginners
- Unity Game Development Blueprints
- 標簽類目體系:面向業務的數據資產設計方法論
- Learning Ansible