Computer Science, asked by williamssiren686, 6 months ago

difference between && and & in java

Answers

Answered by pratikaagnihotri666
1

Answer:

&& is a logical operator and is used to give the statement true if it is or false

& is a bitwise operator .////

have a nice day.//

NIce question from your side ./////

Answered by ronak7165
3

Answer:

&& is AND where as || is OR operator. && looks for false, means if first argument false, it wont test second whether it is true or false. || looks for true, means even though first argument false, it test for second. If both are false then false otherwise true.

What does && mean in Java?

logical

&& is logical and. && combines two boolean values and returns a boolean which is true if and only if both of its operands are true. For instance boolean b; b = 3 > 2 && 5 < 7; // b is true b = 2 > 3 && 5 < 7; // b is now false. || is logical or.

& is a bitwise operator and compares each operand bitwise. Whereas && is a logical AND operator and operates on boolean operands. ... If both the operands are true, then the condition becomes true otherwise it is false.

Similar questions