The comments are used for explaining the code. The comments make the understandability of program faster. The comments improves the readability of the code.
Any language provides 3 types of comments:
- Single line
Single Line Comments:
using the single line comments we can write a message in single line. The single line comments begin with // symbols and they end in the same line.
Example: // This is a single line comment
Multi Line Comments:
Using the multiline we can write the message in multiple lines. Multi line comments begin with /* and ends with */. In between these symbols we can specify any number of lines.
Example: /* This is line one comment
This is line two comment
This is line three comment */
Using the documentation comments we can create the manual for project that is developed. Using these comments we can create the API (Application Programing Interface). The documentation comments begins with /** and ends with */.
Example: /** author: Androindian
created on: 27/05/2021
last modified: 28/05/2021 */