- 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
推薦閱讀
- Clojure Programming Cookbook
- Spring Boot 2實戰之旅
- Vue 3移動Web開發與性能調優實戰
- Reporting with Visual Studio and Crystal Reports
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- Visual C#.NET程序設計
- Instant Lucene.NET
- C語言從入門到精通
- Test-Driven JavaScript Development
- Python 3.7從入門到精通(視頻教學版)
- Android群英傳
- MongoDB Cookbook(Second Edition)
- 面向對象程序設計及C++(第3版)
- 游戲設計的底層邏輯
- Android項目實戰:博學谷