Does Java 10 provide a val keyword? If not, why not?

后端 未结 3 1465
后悔当初
后悔当初 2021-02-03 18:58

Java 10 brings a C#-like var keyword for local type-inference.

But does Java 10 also provide a val keyword, as is found in Scala?

3条回答
  •  迷失自我
    2021-02-03 19:48

    If you want to use "val", that is, "final var", you always can to use Lombok's val.

提交回复
热议问题