- 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
推薦閱讀
- JavaScript+DHTML語法與范例詳解詞典
- Oracle 12c中文版數據庫管理、應用與開發實踐教程 (清華電腦學堂)
- Python高級編程
- Java軟件開發基礎
- SharePoint Development with the SharePoint Framework
- Reactive Android Programming
- PhoneGap:Beginner's Guide(Third Edition)
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- 批調度與網絡問題的組合算法
- Getting Started with React Native
- Django 3.0應用開發詳解
- Mastering Concurrency in Python
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- 從零開始學UI設計·基礎篇
- Visual FoxPro數據庫程序設計