
上QQ阅读APP看书,第一时间看更新
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.