Comments in Java
Multiline comment
- It is used to explain the code to make it more readable.
- It is not considered as a part of program,in other word we can saya that compiler ignores the comment.
- java comments are statements that are not executed by the compiler.
- Single line comment
- Multiline comment
- It is used to comment only one line.
- Two forward slashes(//) is used for single line comment.
- Single line comment starts with double forward slashes.
//this is a single line comment System.out.println("you are excellent");
- Multiline comment is used to comment a block of code.
- Multiline comment statrts with /* and ends with */.
- The text between /* and */ is not executed by the compiler.
Comments in Java || Java Tutorials || MrDarkTechy
Reviewed by Salman Shaikh
on
April 12, 2020
Rating:
