The difference of a local variable being final
or effectively final
has been discussed here. I do not really understand though, why it was introduced in Java 8. To me it seems like it just gives the programmer the freedom to leave out the final
keyword, but treating the variable effectively as final. No change in logic, just a helper for the 'lazy' programmer not to need to write final
.
Isn't that even a step-back, since now a variable that is effectively final misses the keyword, not indicating it to the reader of the code. So is there a reason for Oracle to allow leaving out the final keyword here?