/* */ Click to Join Live Class with Shankar sir Call 9798158723

Java Comments ?

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.

  1. Single Line Comment
  2. 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.

/*This is multi line comment*/