Bird
0
0

You want to document a Kotlin function so that IDEs can show its description. Which comment style should you use?

hard📝 Application Q8 of 15
Kotlin - Basics and JVM Runtime
You want to document a Kotlin function so that IDEs can show its description. Which comment style should you use?
A// This function adds two numbers
B/* This function adds two numbers */
C/** This function adds two numbers */
D<!-- This function adds two numbers -->
Step-by-Step Solution
Solution:
  1. Step 1: Understand documentation comment purpose

    Documentation comments are parsed by IDEs to show descriptions.
  2. Step 2: Identify correct comment style

    Kotlin uses /** ... */ for documentation comments recognized by tools.
  3. Final Answer:

    /** This function adds two numbers */ -> Option C
  4. Quick Check:

    Use /** ... */ for IDE documentation [OK]
Quick Trick: Use /** ... */ for function documentation [OK]
Common Mistakes:
MISTAKES
  • Using // which is just a comment
  • Using /* ... */ which is not documentation
  • Using HTML comments which are invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes