Bird
0
0

How do you correctly write a multi-line comment in Kotlin?

easy📝 Syntax Q3 of 15
Kotlin - Basics and JVM Runtime
How do you correctly write a multi-line comment in Kotlin?
A// This is a multi-line comment //
B/* This is a multi-line comment */
C<!-- This is a multi-line comment -->
D# This is a multi-line comment #
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kotlin comment syntax

    Kotlin uses /* ... */ for multi-line comments.
  2. Step 2: Verify options

    /* This is a multi-line comment */ correctly uses /* and */ to enclose the comment.
  3. Final Answer:

    /* This is a multi-line comment */ -> Option B
  4. Quick Check:

    Multi-line comments use /* ... */ [OK]
Quick Trick: Multi-line comments are enclosed with /* and */ [OK]
Common Mistakes:
MISTAKES
  • Using // for multi-line comments
  • Using HTML comment syntax
  • Using # which is not valid in Kotlin

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes