The Java comments are the statements in a program that are not executed by the compiler and interpreter. While executing the program the compiler or the interpreter ignores the java comments.
There are Two types of comments in Java.
Single Line Comment
Multi Line Comment
Single Line Comment Single-line comment are used to comment only one line of a code.There is no any specific place for comments but it is recommended to add comments in the same indentation level of the code.
See the following syntax of java single-line comment.
// this is single line java comment
Multi Line Comment Multi-line comment is used to comment multiply lines of code.multi-line comment contains only 2 lines. We add a text showing that it’s a multi-line comment in between the “/*” and “*/” characters
See the following syntax of java Multi-line comment.