Skip to main content Skip to docs navigation
TechSpiderTutorials

Java Comments

java Comments will have the following usages:

  1. To make a statement or a block of code as non-executable statements. (Comments are ignored by the compiler)
  2. To describe a program Or a statement Or a block to code (that are useful to other programmers)

Single Line Comments

// Single line comment

Multi Line Comments

/* Multi line comments*/

Documentation Comments

/** documentation */

This indicates a documentation comment (doc comment, for short). The compiler ignores this kind of comment, just like it ignores comments that use /* and */. The javadoc tool uses doc comments when preparing automatically generated documentation. For more information on javadoc, see the Javadoc tool documentation .