In java, say I have the following
==fileA.java== class A { public static final int SIZE = 100; }
Then in another file I use this valu
Java does optimise these sorts of values but only if they are in the same class. In this case the JVM looks in A.SIZE rather than optimizing it because of the usage case you are considering.