Final for function parameter optimization
Is there any n开发者_如何学JAVAoticeable optimization made by JVM when I add final to parameter in Java?
Short answer: no. Longer answer: nope.
It only helps you to make sure that you are not changing the reference to the objects passed through the parameters .. but with regards to the JVM, it does not make any difference
It might not have a performance uptick for the variables, but it will have a performance uptick for making methods final, as it increases the likelihood the JVM will inline/JIT the method.
精彩评论