Remix.run Logo
tpm 3 days ago

Yeah - it's a bit non-intuitive you can change the value of a number.

https://thedailywtf.com/articles/Disgruntled-Bomb-Java-Editi...

J-Kuhn 2 days ago | parent | next [-]

Such hacks will slowly stop working (without explicitly allowing it from the command line.)

In this example, it would throw an IllegalAccessException, because java.base doesn't open java.lang.

vips7L 16 hours ago | parent [-]

Doesn’t field.setAccessible(true) already throw on a modern version?

inigyou 3 days ago | parent | prev [-]

In Python 2 you could literally do

    True = False
and of course in JavaScript

    undefined = "a string"
swiftcoder 2 days ago | parent [-]

The terrifying part of this in Java, is that it applies program-wide, including to constants set before you changed the value