by Dinesh Thakur

Comments are usually non executable statements which are meant for the programmers own convenience. A comment is usually explanation regarding the statement. There are three types of comments in java. They are:

 

1. Single line comment

2. Multi line comment

3. Documentation comment

 

1. Single line comment

 

Single line comment allows only one line. These comments must begin with //.

 

2. Multi line comment

 

If the comment exceeds more than one line, multiline comment is used. Multiline comment begin with /* and end with */.

3. Documentation comment

 

Documentation comment is used to generate document automatically. Documentation comment begin with /** and end with */.