+ 1
Comments
We learned in previous lessons that a statement should end with a semicolon, but here, the statement // prints "Hello World!" doesn't end with a semicolon.
2 Réponses
+ 1
Hi. Comments are ignored by default.
+ 1
Any single line starting with // are comments, and comments are ignored by the compiler, so no need to adhere to code requirements (semicolon as statement terminator).
Multiple lines in code can be defined as comment by the multiline comment signature. As follows:
/*
This is a comment
Spread across multiple line
Because it doesn't fit written
In a single line
*/
For future reference, when asking about a chapter in a lesson, include the language in Relevant Tags, and attach the chapter/subchapter link - just to be clear : )