Comments and embedded documentation
There are two types of comments in Java. The first is the traditional C-style comment that was inherited by C++. These comments begin with a /* and continue, possibly across many lines, until a */. Note that many programmers will begin each line of a continued comment with a *, so you’ll often see:
/* This is a comment
* that continues
* across lines
*/
Remember, however, that everything inside the /* and */ is ignored, so there’s no difference in saying:
/* This is a comment that
continues across lines */
The second form of comment comes from C++. It is the single-line comment, which starts at a // and continues until the end of the line. This type of comment is convenient and commonly used because it’s easy. You don’t need to hunt on the keyboard to find / and then * (instead, you just press the same key twice), and you don’t need to close the comment. So you will often see:
// This is a one-line comment