Search code examples
javaclassvariablesfinal

Does the classic variable declare as final contain a different segment of memory than the non-final variable?


Maybe it's simple questions, but I can't find an answer.

Does the classic variable declare as final contain a different segment of memory than the non-final variable?


Solution

  • I would say, speaking about a local variable, no on the basis of this answer:

    The truth is, there is no final modifier for local variables at the bytecode level.