Skip to content
Justice Tech School

Kotlin Comments

Use // for one line and /* */ for several. KDoc comments start with /** and document functions for tools and editors.

Example
// single line
/* multi
   line */
/** Adds two numbers. */
fun add(a: Int, b: Int) = a + b
println(add(1, 2))

Exercise

Start a line comment.

 note

Quiz Test

Which marks a single line comment?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.