Hey guys in this tutorial, We goona learn Java comments, It is not executable by compiler this is just for human-readable content and people always use it just for understanding Java codes.
There are two types of Java comments:
- single-line comment
- and multiline comments
comments will not be executed by compiler it's just only for human-readable
Single-line comments
Single-line comments start with two forward slashes //.
example:
// This is a comment
System.out.println("Hello World");
Java Multi-line Comments
Multi-line comments start with /* and ends with */.
example:
/*This is a comment
another hello world program
next line comment
*/
System.out.println("Hello World");
Output:
Hello World |