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

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

主站蜘蛛池模板: 平潭县| 马龙县| 紫金县| 永德县| 上饶市| 尚义县| 揭西县| 襄汾县| 信阳市| 巴里| 黎川县| 凤庆县| 景宁| 雅安市| 兴隆县| 泰州市| 津市市| 黔西| 龙泉市| 安乡县| 望城县| 印江| 文化| 花莲县| 房山区| 武威市| 嵩明县| 南澳县| 南靖县| 镇原县| 益阳市| 固安县| 阜康市| 达州市| 綦江县| 江都市| 天气| 泽库县| 虞城县| 峡江县| 广丰县|