<code>(s != null && s.length() > 0)</code> is safe because
- A
It's a runtime trick
- Bcheck_circle
Short-circuit prevents calling length() on null
- C
Java auto-checks null
- D
Always throws NPE
Explanation
If s is null, the && stops at the first part; length() is not called.