English

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:

  1. Single-Line Comment (//): It is used to write a comment on a single line.
    Example: // This is a single-line comment
  2. Multi-Line Comment (/* ... */): It is used to write comments that extend over multiple lines.
    Example: /* This is a multi-line comment */
  3. 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?
Chapter 3: Programming in Java (Review of Class XI Sections B and C) - EXERCISE [Page 98]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 3 Programming in Java (Review of Class XI Sections B and C)
EXERCISE | Q 20. | Page 98
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×