Search code examples
javafinalpmd

Final variables


Possible Duplicate:
Why would one mark local variables and method parameters as “final” in Java?

I used PMD in my code and it always tells me to make method local variables final. Can someone tell me how this effects the general performance apart from making the code more readable.


Solution

  • There's no effect on performance and it's debatable whether it's more readable. Java should have made variables final by default.