Bird
0
0

Why should you prefer documentation comments (/** ... */) over regular comments (/* ... */) for public Kotlin functions?

hard📝 Conceptual Q10 of 15
Kotlin - Basics and JVM Runtime
Why should you prefer documentation comments (/** ... */) over regular comments (/* ... */) for public Kotlin functions?
ADocumentation comments can be parsed by tools to generate API docs
BDocumentation comments are ignored by the compiler
CRegular comments cause runtime errors
DRegular comments are faster to write
Step-by-Step Solution
Solution:
  1. Step 1: Understand purpose of documentation comments

    Documentation comments are designed to be read by tools to create API documentation.
  2. Step 2: Compare with regular comments

    Regular comments are ignored by tools and only serve as notes in code.
  3. Final Answer:

    Documentation comments can be parsed by tools to generate API docs -> Option A
  4. Quick Check:

    Documentation comments support API docs generation [OK]
Quick Trick: Use /** ... */ for comments that generate docs [OK]
Common Mistakes:
MISTAKES
  • Thinking regular comments cause errors
  • Believing documentation comments are ignored
  • Choosing speed over documentation quality

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes