There are two types of annotations in Java. The first is a traditional, C-style annotation, inherited from C + +. These comments start with a "/*", followed by a comment, and can span multiple lines, ending with a "* *". Note that many programmers start with a "*" in each row of a continuous annotation, so you can often see things like the following:
* * This is
* A note,
* It spans multiple lines
*/
But keep in mind that everything between/* and * * is ignored when compiling, so the above comment is no different from the following note:
/* This is a note,
It spans multiple lines.
The second type of annotation also originated in C + +. This annotation is called a "single-line comment" and begins with a "//" to indicate that all content in the line is a comment. This type of annotation is more common because it is easier to write. There is no need to look for "/" on the keyboard, and then look for "*" (just press the same key two times) and do not have to add a closing tag at the end of the comment. Here is an example of this type of annotation:
This is a single-line comment