Analyst Integration Question:
What is difference between & and && operator?
Answer:
& is a bitwise operator while && is a logical operator. One difference between & and && is that bitwise operator (&) can be applied to both integer and boolean but logical operator (&&) can only be applied to boolean variabes. When you do a & b then AND operator is applied to each bit of both integer number, while in case of of a && b , second argument may or may not be evaluated, that's why it is also known as short circuit operator, at least in Java. I like this question and often asked it to junior or developer and college graduates.