I always thought that && operator in Java is used for verifying whether both its boolean operands are true, and the & oper
&&
true
&
&& is a short circuit operator whereas & is a AND operator.
Try this.
String s = null; boolean b = false & s.isEmpty(); // NullPointerException boolean sb = false && s.isEmpty(); // sb is false