Seetharaman's version is fine. It's a very common idiom. The point of using if(string_ != null && !string_.equals("")) is that the expression "short-circuits". If the first part is false it doesn't bother calculating the second part. So you can be sure that if it reaches the second part string_ is definitely not null.