- 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#高級(jí)編程(第10版) C# 6 & .NET Core 1.0 (.NET開(kāi)發(fā)經(jīng)典名著)
- 計(jì)算思維與算法入門(mén)
- C語(yǔ)言程序設(shè)計(jì)(第2版)
- React Native Cookbook
- Elasticsearch for Hadoop
- Learn React with TypeScript 3
- C#開(kāi)發(fā)案例精粹
- Mastering Linux Security and Hardening
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- C#程序設(shè)計(jì)(項(xiàng)目教學(xué)版)
- HTML+CSS+JavaScript網(wǎng)頁(yè)設(shè)計(jì)從入門(mén)到精通 (清華社"視頻大講堂"大系·網(wǎng)絡(luò)開(kāi)發(fā)視頻大講堂)
- C++語(yǔ)言程序設(shè)計(jì)
- 深入理解BootLoader
- Learning Splunk Web Framework
- TypeScript全棧開(kāi)發(fā)