Learn AP Comp Sci

Problem of the Day

Wednesday, March 11, 2026


Problem:

In a Java program, comments written by the programmer

  1. may act as formal documentation for the code
  2. may result in more efficient compiling/execution of the code
  3. may help developers better understand the code
  1. I only
  2. I and II only
  3. I and III only
  4. I, II, and III

Show solution:

The correct answer is c. Multiline comments enclosed in /** .... */ create a JavaDoc note that provides formal documentation for the code. Other multiline comments enclosed in /* ... */ or single-line comments indicated with a // .... provide more informal documentation or information about the the code. All comments are ignored by the compiler however—they have no effect on the execution of the code.