What is Compile Time constant expression value inlined by compiler in JAVA? -


this question has answer here:

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

source of above line

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

Popular posts from this blog

java - Ebean enhancement ignores a model -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -