Javatpoint Logo
Javatpoint Logo

Kotlin Comment

Comments are the statements that are used for documentation purpose. Comments are ignored by compiler so that don't execute. We can also used it for providing information about the line of code. There are two types of comments in Kotlin.

  1. Single line comment.
  2. Multi line comment.

Single line comment

Single line comment is used for commenting single line of statement. It is done by using '//' (double slash). For example:

Output

Hello World!

Multi line comment

Multi line comment is used for commenting multiple line of statement. It is done by using /* */ (start with slash strict and end with star slash). For example:

Output:

Hello World!






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA