- Kotlin Programming By Example
- Iyanu Adelekan
- 74字
- 2025-04-04 17:16:16
Single-line comments
As the name implies, these comments span a single line. Single-line comments are started with two backslashes (//). Upon compilation of your program, all characters coming after these slashes are ignored. Consider the following code:
val b: Int = 957 // This is a single line comment
// println(b)
The value held by b is never printed to the console because the function that performs the printing operation has been commented out.