Is there any differences between doing
Field field = something.getSomethingElse().getField(); if (field == 0) { //do something } somelist.add(field);
There is a performance penalty ( which may be so small it is negligible ) Yet, the JVM may inline this and all the calls to improve the performance.
It would be better if you leave it the second way.