Kotlin Tutorial Beginner Guide for Kotlin Programming Language Tutorial

Comments

Comments

Comments in Kotlin Programming Language is same as available in most of the programming languages. In Kotlin two types of comments are available.

Line Comment

Line Comment or Single line comment is normally used for adding brief pieces of information in your code. Single line comment starts with two forward slashes (//). Following are some examples of single line or line comment

//Hello This Line is going to ignore by compiler

//In case of line comment you can’t break comments in multiple lines

//If we want to combine all above comments we need to use second type

// of comment availbale in Kotlin. 

Block Comment

Block comment is another way to add comments to your code. If you want to add detailed information to your code, you can use block comment. For starting a block comment you need to use /* the next of stuff after forwarding slash and star is a comment. If you want to close the block comment you need to add */. */ is closed any opened comment. Following is the example of a block comment.

/*

Hello this is a  multi line comment

You can slipt it in multiple

lines

*/

 

0 Comments
Leave A Comment

Please login to post your valuable comments.

share