What is Compile Time constant expression value inlined by compiler in JAVA? -
this question has answer here:
- what inlining? 9 answers
recently reading got
"when declare string (which immutable) variable final, , initialize compile-time constant expression, becomes compile-time constant expression, , value inlined compiler used."
and "i'm confused mean value inlined compiler" ? please explain in simple way if possible
when string finalized , initialized @ compile time, compiler can copy-paste string code, instead of looking variable @ every use. similar inline expansion.
final string = "asd"; string b = a;
the above snippet becomes
final string = "asd"; string b = "asd";
Comments
Post a Comment