How to set a double condition in java? | SoloLearn: Learn to code for FREE!

+1

How to set a double condition in java?

1 Answer

New Answer

+3

&& is a logical and (both conditions need to be true) || is a logical or (at least one condition needs to be true) ^ is a xor (exactly one condition needs to be true) (== compares objects by identity) For example: if (firstCondition && (secondCondition || thirdCondition)) { ... }