Kotlin Comments Example

Chapter: Kotlin Last Updated: 11-11-2017 18:09:01 UTC

Program:

            /* ............... START ............... */
                
fun main(args : Array<String>) {

    //This is single line comment

    /* This is
     multi line
     comment */

    /**
    This
    is
    documentation
    comment
     */

    println("Kotlin - Hello World ")

}
                /* ............... END ............... */
        

Notes:

  • As like Java, there are thee types of comments in Kotlin.
  • 1. Single Line Comment
  • 2. Multi Line Comment
  • 3. Documentation Comment
  • The single line comment is used to comment only one line.
  • The multi line comment is used to comment multiple lines of code.
  • The documentation comment is used to create documentation API.
  • In the above program you can see all three comments.

Tags

Comment Example , Kotlin

Similar Programs Chapter Last Updated
Kotlin Continue Kotlin 02-03-2018
Kotlin Break Statement Kotlin 27-01-2018
Kotlin For Loop Kotlin 30-11-2017
Kotlin Do While Loop Kotlin 19-11-2017
Kotlin While Loop Kotlin 19-11-2017
Kotlin When Statement Kotlin 18-11-2017
Kotlin Nested If Kotlin 18-11-2017
Kotlin If Else If Statement Kotlin 22-09-2018
Kotlin If Statement Kotlin 17-11-2017
Kotlin Print And Println Kotlin 22-09-2018
Kotlin Type Conversion Kotlin 17-11-2017
Kotlin Logical Operators Kotlin 17-11-2017
Kotlin Assignment Operators Kotlin 15-11-2017
Kotlin Arithmetic Operators Kotlin 15-11-2017
Kotlin Data Types Kotlin 12-11-2017
Kotlin Variables Example Kotlin 11-11-2017
Kotlin Hello World Kotlin 11-11-2017

1