In my program I have a long if condition
which looks something like this:
if((items.size() > 0 && !k.getText().equals(last)) || cr.isLast() == true)
Now I thought it is easier to read if I use a variable for the first statement so I changed my code into this:
boolean textChanged = items.size() > 0 && !k.getText().equals(last);
if(fachChanged == true || cr.isLast() == true)
Now my question is: Does the second code need more memory because I used a temporary variable or is this optimized from the compiler? I think today it is not so important if one boolean less or more is stored in the memory but there is the wish to create an optimized and memory friendly program.