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

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

主站蜘蛛池模板: 延津县| 济阳县| 丰原市| 德惠市| 平昌县| 南城县| 海城市| 孝昌县| 景宁| 乌恰县| 黑河市| 岳阳县| 苍溪县| 北流市| 鹤山市| 吉木乃县| 邳州市| 合山市| 临沧市| 大庆市| 建湖县| 乌拉特前旗| 东丽区| 东港市| 穆棱市| 木里| 灵武市| 历史| 武平县| 汝南县| 遂川县| 德安县| 闸北区| 涞水县| 三亚市| 蒙城县| 宁武县| 古蔺县| 广德县| 山丹县| 铜梁县|