I happen to come across a Java code at my work place. Here\'s the scenario: There are 2 classes - ClassA
and ClassB
.
ClassA
ha
It's a binary compatibility issue. References to constant fields are resolved at compile time. The behaviour you are seeing is correct; if you change the values in class A then you will have to re-compile the client (class B). To avoid such problems consider adding constants using an enum type, introduced in Java release 5.0.