As the name tells, a Single Line Comment is restricted to one line.
// This is a single line comment ////// Another single line comment //////
Any text that comes between
We can also place a comment by wrapping the text between
*/. This enables having multi-line comment.
/* This is a multiline comment. It spans three lines. Oh! I am the third line. */
Since the end of this comment is marked using
*/, things will go wrong if we try to nest multiline comment.
/* Parent comment starts /* Nested comment */ Parent comment continues */
In the above example, the third line is not part of comment and will throw error.