Twitter LogoFacebook Logo
Comments
Learn how to leave comments on your Kotlin documents
By: King

Comments allow you to leave notes on the Kotlin document. The compiler will ignore those lines and you will not have any syntax errors when writing writing within the comment syntax.

Syntax

// Some comment

/* 

  Multi-Line Comment
  Multi-Line Comment
  Multi-Line Comment
  Multi-Line Comment
*/

Examples

fun add(a: Int, b: Int) {
   // This will add the value of a & b.
   return a + b
}

/*
  This is 
  how I get to school
  everyday.
*/
fun walkToSchool() {
   wakeUp()
   eatBreakfast()
   leaveHouse()
   takeBus()
   enterSchool()
}


Sign In