Explain Java Comments



Q) Define Java Comments?

There are 3 types of comments in JAVA.

a) Single Line Comments:
This Comments start with ‘//’.

For Ex: // This is a single line comment for only one line

b) Multi-Line Comments:
This Comments starts with ‘ /* ‘ and ends with ‘ */ ‘.
For Ex:
/*
—————
—————This is a Multiple line Comments
—————This are also called non executable statements means not executed by java compiler
*/

c) Java Documentation Comments:
This Comment Starts With ‘/**’ and ends with ‘*/’;
For Ex:

/**
——————
—————-These are called Java Documentation Comments.
————–This comments are useful to create a “.html files” called “API documents” from a “.java” program using “Javadoc Compiler“.
*/

Random Posts

  • Uploading file name or image to DataBase
  • URL Connection Class
  • What is unicode System
  • Explain executeUpdate Method
  • Life Cycle of Thread

Post a Comment