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

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

主站蜘蛛池模板: 云林县| 工布江达县| 巴塘县| 莒南县| 凤城市| 郧西县| 常州市| 黎城县| 绥化市| 开封县| 汝阳县| 荥阳市| 北宁市| 德安县| 阳春市| 昌都县| 贵德县| 遂平县| 嘉善县| 碌曲县| 儋州市| 阳江市| 河曲县| 钦州市| 儋州市| 苍梧县| 石台县| 化隆| 舒城县| 乐都县| 云龙县| 新宾| 兴文县| 廊坊市| 汽车| 汕尾市| 随州市| 上思县| 侯马市| 奎屯市| 山阳县|