Explain the REMARK statement in Java.
Advertisements
Question
Explain the REMARK statement in Java.
Explain
Advertisements
Solution
A Remark Statement in Java is used to write comments or explanatory notes in a program. These statements are ignored by the Java compiler and do not affect the execution of the program. They help programmers understand the program easily.
Java supports three types of remark statements:
- Single-Line Comment (
//): It is used to write a comment on a single line.
Example:// This is a single-line comment - Multi-Line Comment (
/* ... */): It is used to write comments that extend over multiple lines.
Example:/* This is a multi-line comment */ - Documentation Comment (
/** ... */): It is used to provide documentation about classes, methods and other program elements.
Example:/** This is a documentation comment */
shaalaa.com
Is there an error in this question or solution?
