3. Java Comments

Comments In Java

Here, there are two types of comments in java. 1. Single line comments. 2. Multi-line comments.

  1. Single line comments denoted by : //
  2. Multi-line comments denoted by : /*……….*/,
// This is a single line comments.

/*
This is a multi-line comments.
 */
Comments text ignored by compilers
comments are used for written notes information of and coding for self use and developers.
Comments are used to understand difficult code and logic.

Program

package com.aonetips;

public class Main {

public static void main(String[] args) {
// write your code here
// This is a single line comments.

/*
This is a multi-line comments.
*/

// Comments text ignored by compilers
// comments are used for written notes information of and coding for self use and developers.
// Comments are used to understand difficult code and logic.
}
}

Leave a Comment

Your email address will not be published.

Shopping Cart