Java comments are devided into three types
Single-line comments start with two forward slashes (//). Any line starts with // java will ignore this line from the execution.
// This is a comment
System.out.println("Hello World");
System.out.println("Hello World"); // This is a comment
If we want to declare a comments at multiple lines then multi-line comments will be used, these comments start with /* and ends with */.
/* The code below will print the words Hello World
to the screen, and it is amazing */
System.out.println("Hello World");
document type comments start with /* and ends with */ and each line starts with *
/* The code below will print the words Hello World
* this is sample document type comment
* to the screen, and it is amazing
*/
System.out.println("Hello World");