192k views
3 votes
you can use the ____ which is written as || if you want action to ocur when atleast one of two conditions is true.

1 Answer

1 vote

Answer:

The correct answer to the following question will be "Conditional OR operator".

Step-by-step explanation:

The Conditional logical OR operator, also known as the logical OR operator "short-circuiting," calculates the operands ' logical OR. y tests are valid if either x or y is correct. The logical OR operator often determines the logical OR of all its operands but checks all operands at all times.

An example of the conditional operator is given below:

int number = 16;

if (number % 2 == 0 && number % 4 == 0)

{

System.out.println("Num is divisible by four or two");

}

else

{

System.out.println("Num is not divisible by four or two");

}

Therefore, a Conditional logical OR operator is the right answer.

User Felipe Santana
by
4.8k points