There's no comment feature on the site, but I thought it was worth mentioning that
a) it is not possible to modify *final* fields in all versions of the JDK. This was originally supported, then pulled in (I think) 1.4, then added back in (I think) 1.5.
b) final values are compiled into other classes compiled with that class. So you can change the value of it and other classes may still see the original value. Thus, this is *really* unlikely to work in a way you expect.
Comments
puredanger replied ago:
There's no comment feature on the site, but I thought it was worth mentioning that
a) it is not possible to modify *final* fields in all versions of the JDK. This was originally supported, then pulled in (I think) 1.4, then added back in (I think) 1.5.
b) final values are compiled into other classes compiled with that class. So you can change the value of it and other classes may still see the original value. Thus, this is *really* unlikely to work in a way you expect.
Note, these apply to final fields only.
William Louth replied ago:
I think you should qualify (a) because it is possible but not via reflection.
eabarquez replied ago:
That's a funny title. Lol.
Voters For This Link (7)
Voters Against This Link (1)