Here are two versions of the same method.
public static int getSomeValue() {
return getValueX() * getValueY() - getValueZ();
}
public static int getSomeValue() {
int jX = getValueX();
int jY = getValueY();
int jZ = getValueZ();
int jRet = jX * jY - jZ;
return jRet;
}
The second method is great for debugging, one can put a break point on say "return jRet" and inspect the three values.
Will the Compiler / JVM optimize these variables out?