Recall & Review
beginner
What is the syntax for a single-line comment in Kotlin?
Use two forward slashes
// before the comment text. Everything after // on that line is ignored by the compiler.Click to reveal answer
beginner
How do you write a multi-line comment in Kotlin?
Start with
/* and end with */. Everything between these markers is treated as a comment, even if it spans multiple lines.Click to reveal answer
intermediate
What is the purpose of KDoc in Kotlin?
KDoc is Kotlin's documentation syntax. It helps you write clear explanations for classes, functions, and properties that tools can use to generate documentation.
Click to reveal answer
intermediate
How do you write a KDoc comment for a function in Kotlin?
Use
/** ... */ before the function. Inside, you can add descriptions and tags like @param and @return to explain parameters and return values.Click to reveal answer
advanced
Can you nest multi-line comments in Kotlin?
Yes, Kotlin allows nesting multi-line comments. You can start a new
/* ... */ comment inside another multi-line comment.Click to reveal answer
Which symbol starts a single-line comment in Kotlin?
✗ Incorrect
Single-line comments in Kotlin start with two forward slashes
//.How do you write a multi-line comment in Kotlin?
✗ Incorrect
Multi-line comments in Kotlin start with
/* and end with */.What is the correct way to start a KDoc comment?
✗ Incorrect
KDoc comments start with
/** and end with */.Which tag is used in KDoc to describe a function parameter?
✗ Incorrect
The
@param tag describes a function parameter in KDoc.Can multi-line comments be nested in Kotlin?
✗ Incorrect
Kotlin supports nesting multi-line comments inside other multi-line comments.
Explain the different types of comments available in Kotlin and when to use each.
Think about quick notes, longer explanations, and documentation.
You got /4 concepts.
Describe how to write a KDoc comment for a function including parameters and return value.
Imagine explaining your function to a friend who will use it.
You got /4 concepts.