Comments | Sololearn: Learn to code for FREE!

+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.

10/5/2019 5:23:10 AM

Yash Malaviya

2 Answers

New Answer

+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 : )