Comments | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

5th Oct 2019, 5:23 AM
Yash Malaviya
Yash Malaviya - avatar
2 Answers
+ 1
Hi. Comments are ignored by default.
5th Oct 2019, 5:47 AM
Dmytro Novak
Dmytro Novak - avatar
+ 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 : )
5th Oct 2019, 5:51 AM
Ipang