A good answer might be:

No. Remember, the compiler completely ignores them. Comments are just for humans.

Many Comments

Comments can be placed after a program statement to explain what it does, as here:


class Haiku
{
  public static void main ( String[] args )
  {
    System.out.println("On a withered branch" );  // Write first line of the poem
    System.out.println("A crow has just alighted:");  // Write 2nd line of the poem
    System.out.println("Nightfall in autumn.");  // Write 3rd line of the poem
  }
}

As with all comments, the "//" and everything after it on that line are ignored by the complier. The program statement in the start of the line is not affected by the comment. Often you want to use several lines for a comment like this:

/* Program 1

Write out three lines of a poem.
The poem describes a single moment in time,
using 17 syllables.
*/

class Haiku
{
  public static void main ( String[] args )
  {
    System.out.println("On a withered branch" );
    System.out.println("A crow has just alighted:");
    System.out.println("Nightfall in autumn."); 
  }
}

With this style of comment, everything between the two characters "/*" and the two chracters "*/" are ignored by the compiler. Between the "/*" and the "*/" can be many lines of comments.

QUESTION 13:

Why would you ever want to use comments to help a person understand your program?

Click Here after you have answered the question