Comments in Java

Just as in the case of C++ and C, Java supports two types of comments namely, single line comments and multi-line comments. The syntax for these types of comments are as follows:

Single line comment:

//<comment>

Multiple line comment:

/*<comment>*/

All characters that exist in the comments region are simply ignored by the Java compiler. Using Blank Lines:

Any line that is only composed of white space characters or comments is considered a blank line. These lines are just ignored by the compiler and are not included in the executable.