4 ms·
I'm not getting #17: Trust Nonstatic Final Fields. > what happens if someone changes that field? The field is final. The static is final. How can the field be
by MaxBarraclough 7y ago
I'm not getting #17: Trust Nonstatic Final Fields.
> what happens if someone changes that field?
The field is final. The static is final. How can the field be changed? Reflection?
- UncleMeat 7y agoFinal applies to the field, not the object. You can still mutate the object pointed at by a final field.
- MaxBarraclough 7y agoSure, but the instance's only field, is final. The static reference KNOWN_M is final, and the only field of the pointed-to instance, x, is also final.