<div dir="ltr" style="text-align: justify;" trbidi="on">Whenever we want to write a program, we should first think about writing comments. <i><b>What are comments?</b></i> Comments are description about the features of a program. This means whatever we write in a program should be describe using comments. <i><b>Why should we write comments?</b></i> When we write comments, we can understand what the program is doing as well as helps others to easily follow our code. This means readability and understand ability of a program will be more. If a program is understandable, then only can it be usable in a software. If other members of the software development team can not understand our program, then they may not able to use it in project and will reject it. So writing comments is compulsory in any program. Remember, it is good programming habit.</p>
<p> <b>There are three types of comments in Java.</b><br />
<b>1. single line comment</b><br />
<b>2. multi line comment </b><br />
<b>3. java documentation</b></p>
<div align='center' id="ads-id"></div>
<p> <b>Single Line Comments:</b><br />
These comments are for making a single line as a comment. These comments start with double slash symbol // and after this, whatever we written till end of the line is taken as a comment.</p>
<p><b>Example:</b></p>
<pre class="highlight" name="code">//This is my comment of one line.
</pre>
<p>
<b>Multi Line Comments:</b><br />
These comments are used for representing several lines as comments. These comments start with /* and end with */. In between /* and */, whatever is written is treated as a comment.</p>
<p>Example:</p>
<pre class="highlight" name="code">/* This is a multi line comment. This is line one.
This is line two of the comment
This is line three of the comment. */
</pre>
<p>
<b>Java Documentation Comments:</b><br />
These comments start with /** and end with */. These comments are used to provide description for every feature in a Java program. This description proves helpful in the creation of a <b><i>.html</i></b> file called API(Application Programming Interface) document. Java Documentation comments should be used before every feature in the program as shown here:</p>
<pre class="highlight" name="code">/** description about the class */
Class code{

/** description about a method */
Method code(){

 }
}
</pre>
<p></p>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/02/java-basic-data-types.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/01/core-java-baby-step-to-be-best-java-ian.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/02/operators-in-java.html">Next</a> >;>;</b></div>
<p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/java-basic-data-types/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/operators-in-java/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '561'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…