Is using hard-coded integer values in code a BAD practice from memory considerations <p>Consider a simple following code in Java:</p> <pre><code>void func(String test) { if(str.length() &gt; 0) { //do something } } </code></pre> <p>Does executing str.length() > 0 means that every time this function is called, 4 bytes of memory will be allocated to store 0 integer value ?</p>