Bird
0
0

Which comment style should you use in Kotlin to write documentation that tools can extract to generate API docs?

hard📝 Application Q15 of 15
Kotlin - Basics and JVM Runtime
Which comment style should you use in Kotlin to write documentation that tools can extract to generate API docs?
A/** This is a documentation comment */
B/* This is a documentation comment */
C// This is a documentation comment
D<!-- This is a documentation comment -->
Step-by-Step Solution
Solution:
  1. Step 1: Identify documentation comment syntax in Kotlin

    Kotlin uses /** ... */ for documentation comments that tools can parse.
  2. Step 2: Compare with other comment types

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

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

    Documentation comments use /** ... */ [OK]
Quick Trick: Use /** ... */ for documentation comments in Kotlin [OK]
Common Mistakes:
MISTAKES
  • Using // or /* */ for documentation comments
  • Confusing documentation comments with regular comments
  • Using HTML comment style by mistake

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes