Programmer Coding

Java Comments

Comment is basically used when we do not want to execute the statement.

Type of Java comments

There are mainly two type of java comment.

  1. Single Line comment.
  2. Multi Line comment.

Single line comment  :-

The single line comment Is used for comment only one line.

Syntax:-

// this is single line comment (‘//’)

Example:-

public static void main(String[] args) {
System.out.println(“programmer coding”); //our first program
}

 

out put:-

              programmer coding

 

Multiline comment

Multi line comment is used to comment multiple line at a time.

Syntax:-

/* this is multi

line comment */

Example:-

public static void main(String[] args) {
System.out.println(“programmer coding”); /*this is  our
first
program*/

Leave a Comment

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

Scroll to Top