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

前端 未结 13 2647
感情败类
感情败类 2020-11-22 10:33

I always thought that && operator in Java is used for verifying whether both its boolean operands are true, and the & oper

13条回答
  •  一生所求
    2020-11-22 11:15

    & is a bitwise operator plus used for checking both conditions because sometimes we need to evaluate both condition. But && logical operator go to 2nd condition when first condition give true.

提交回复
热议问题