So, I downloaded the new version Netbeans 8some time ago. In this new version, every time I declare a variable privateand assign a value to it only once, it netbeansoffers me to make the field final, because it never changes.
Well, I understand that the variable finalhas a value **, which has the advantage of declaring private final int x=3;aka constant over variable private int x=3;and never changes it **
I'm thinking of
- Concurrency? - But for me it does not make sense if the value of the non-final variable remains unchanged all the time
- Speed? - I think this may be the reason (some caching?), But I'm not sure
Any clarifications would be appreciated.
Ziker source
share