Bird
0
0

In Kotlin, what does the expression !true || false evaluate to?

easy📝 Conceptual Q2 of 15
Kotlin - Data Types
In Kotlin, what does the expression !true || false evaluate to?
Afalse
Btrue
Cnull
DCompilation error
Step-by-Step Solution
Solution:
  1. Step 1: Apply NOT operator

    !true becomes false.
  2. Step 2: Evaluate OR operator

    false || false is false.
  3. Final Answer:

    !true || false evaluates to false -> Option A
  4. Quick Check:

    NOT and OR logic = A [OK]
Quick Trick: NOT (!) flips the boolean value before OR (||) evaluation [OK]
Common Mistakes:
MISTAKES
  • Forgetting to apply NOT operator first
  • Assuming OR with false always true
  • Confusing boolean literals

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes