is there any concept called “Constant Folding” in java?

前端 未结 2 422
时光说笑
时光说笑 2020-12-04 03:23

is there any concept called \"Constant Folding\" in java? if yes what is it?

2条回答
  •  遥遥无期
    2020-12-04 03:53

    Constant folding is the process of simplifying constant expressions at compile time. Terms in constant expressions are typically simple literals, such as the integer 2, but can also be variables whose values are never modified, or variables explicitly marked as constant

    Yes, it's exists on Java: Compiler optimizations

提交回复
热议问题