Bird
0
0

Which of the following is the correct syntax for the logical AND operator in Kotlin?

easy📝 Syntax Q12 of 15
Kotlin - Data Types
Which of the following is the correct syntax for the logical AND operator in Kotlin?
A&&
B||
Cand
D!
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kotlin logical operators

    Kotlin uses && for logical AND, || for OR, and ! for NOT.
  2. Step 2: Match operator to AND

    The operator && combines two Boolean expressions and returns true only if both are true.
  3. Final Answer:

    && -> Option A
  4. Quick Check:

    AND operator = && [OK]
Quick Trick: AND is double ampersand && in Kotlin [OK]
Common Mistakes:
MISTAKES
  • Using || instead of && for AND
  • Writing 'and' as a keyword
  • Confusing NOT (!) with AND

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes