Comments In Java

java

Comments are used to making program human readable.

Comments are those statements which will not executed by compiler or interpreter.

There are two types of comments in java

  • Single line comment
  • Multi-line comment

Single line comment

Single line comments start with “//”

//This is a single line comment's example

Multi line comment

Multi line comment start with “/*” and ends with “*/”

Anything in between multi line comment will be ignored by compiler and interpreter.

Below is example of multi line comment.

/* This is
Multiline
Comment */

Leave a Comment

Your email address will not be published. Required fields are marked *