- Java 11 and 12:New Features
- Mala Gupta
- 126字
- 2021-07-02 12:26:58
Type Inference
The ability to use type inference with local variables (var) is one of the star features of Java 10. It reduces the verbosity of the language without compromising Java's dependable static binding and type safety. The compiler infers the type by using the information available in the code, and adds it to the bytecode that it generates.
Every new concept has its own set of benefits, limitations, and complexities. Using type inference with var is no exception. As you work through this chapter, using var will enthrall and frustrate you, but you will emerge triumphantly.
In this chapter, we'll cover the following topics:
- What is type inference?
- Type inference with var
- Dos and don'ts of working with var
- Type inference versus dynamic binding
推薦閱讀
- 三維圖形化C++趣味編程
- Python編程:從入門到實踐
- Mastering Android Development with Kotlin
- Apache Kafka Quick Start Guide
- 軟件測試實用教程
- C語言程序設計
- INSTANT Sinatra Starter
- 移動互聯網軟件開發實驗指導
- Android應用開發深入學習實錄
- 自學Python:編程基礎、科學計算及數據分析(第2版)
- Serverless Web Applications with React and Firebase
- C陷阱與缺陷
- Vue.js 3應用開發與核心源碼解析
- 計算機應用基礎(第二版)
- Puppet Cookbook(Third Edition)