- 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.
推薦閱讀
- MySQL數據庫進階實戰
- Building Computer Vision Projects with OpenCV 4 and C++
- Google Visualization API Essentials
- Effective Amazon Machine Learning
- 使用GitOps實現Kubernetes的持續部署:模式、流程及工具
- 大數據可視化
- 大數據:規劃、實施、運維
- 商業分析思維與實踐:用數據分析解決商業問題
- 數據驅動設計:A/B測試提升用戶體驗
- Spark大數據編程實用教程
- The Game Jam Survival Guide
- Python數據分析從小白到專家
- Unity 2018 By Example(Second Edition)
- Oracle高性能SQL引擎剖析:SQL優化與調優機制詳解
- MySQL數據庫實用教程