What is the difference between & and && in Java?

I always thought that && operator in Java is used for verifying whether both its boolean operands are true, and the & operator is used to do Bit-wise operations on two integer types.

Recently I came to know that & operator can also be used verify whether both its boolean operands are true, the only difference being that it checks the RHS operand even if the LHS operand is false.

Is the & operator in Java internally overloaded? Or is there some other concept behind this?

15 Answers
15

Leave a Comment