Comments

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

No. Everything is so confused, a slight mistake is easily overlooked.

Comments

A comment is a note written to a human reader of a program. A comment starts with the two characters "//" (slash slash). Those characters and everything that follows them on that one line are ignored by the java compiler.

// Write three lines of a poem to the computer monitor
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.");
  }
}

The program compiles and runs exactly the same as before. The green color in the above program was added by hand. However, most program editors (such as CodeGenie and BlueJ) are smart enough to recognize comments and will display them in color. Of course, the text file contains only the characters you have entered.

QUESTION 13:

Are comments included in the bytecode translation of a Java program?