Bird
0
0

Which of the following is the correct syntax for a multi-line comment in Kotlin?

easy📝 Syntax Q12 of 15
Kotlin - Basics and JVM Runtime
Which of the following is the correct syntax for 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 multi-line comment syntax in Kotlin

    Kotlin uses /* ... */ to write multi-line comments.
  2. Step 2: Analyze options

    /* This is a multi-line comment */ correctly uses /* ... */. // This is a multi-line comment is single-line comment syntax. /** This is a multi-line comment */ is documentation comment syntax. <!-- This is a multi-line comment --> is HTML comment syntax.
  3. Final Answer:

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

    Multi-line comment = /* ... */ [OK]
Quick Trick: Multi-line comments use /* and */ to start and end [OK]
Common Mistakes:
MISTAKES
  • Using // for multi-line comments
  • Confusing documentation comments /** */ with regular multi-line comments
  • Using HTML style comments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes