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

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

主站蜘蛛池模板: 延寿县| 登封市| 惠水县| 云南省| 本溪市| 江北区| 双柏县| 龙南县| 桐乡市| 益阳市| 乃东县| 南木林县| 朝阳区| 湖口县| 青岛市| 永春县| 新乡县| 商城县| 越西县| 桂平市| 彭州市| 芦山县| 石渠县| 翼城县| 普陀区| 无极县| 游戏| 丽江市| 麻城市| 铁岭县| 德江县| 阿拉善右旗| 迭部县| 英山县| 沁水县| 永川市| 锡林浩特市| 巩留县| 芮城县| 达州市| 突泉县|