官术网_书友最值得收藏!

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

主站蜘蛛池模板: 泸定县| 洪江市| 理塘县| 五寨县| 高密市| 雅江县| 新宁县| 赤壁市| 攀枝花市| 改则县| 汝州市| 简阳市| 子长县| 普兰店市| 彭泽县| 正定县| 台北县| 新疆| 聂荣县| 虎林市| 含山县| 基隆市| 靖西县| 长岭县| 哈巴河县| 郓城县| 张掖市| 上犹县| 甘泉县| 张家口市| 安徽省| 衡东县| 陇西县| 丹巴县| 巴塘县| 广河县| 丰台区| 海盐县| 内乡县| 新邵县| 民县|