Complete the code to check if both conditions are true using the AND operator.
boolean result = (a > 5) [1] (b < 10);
The AND operator in Java is &&. It returns true only if both conditions are true.
Complete the code to check if either condition is true using the OR operator.
boolean result = (x == 0) [1] (y == 1);
The OR operator in Java is ||. It returns true if at least one condition is true.
Fix the error in the code to negate the condition correctly.
boolean isFalse = [1] flag;The NOT operator in Java is !. It negates the boolean value.
Fill all three blanks to create a condition that checks if number is between 10 and 20 inclusive.
boolean inRange = (number [1] 10) [2] (number [3] 20);
To check if a number is between 10 and 20 inclusive, use >= and <= with AND &&. Here, BLANK_1 is >= (A), BLANK_2 is && (B), and BLANK_3 is <= (C).
Fill all three blanks to create a condition that checks if a character is a vowel (a, e, i, o, u).
boolean isVowel = (ch == 'a') [1] (ch == 'e') [2] (ch == 'i') [3] (ch == 'o') || (ch == 'u');
To check if ch is any vowel, use OR || between each equality check.