Java OCA OCP Practice Question 1614

Question

Which statement about the following comment is true?

/* // */

Select the one correct answer.

  • (a) The comment is not valid.
  • The multiple-line comment (/* ... */) does not end correctly, since the comment-end sequence */ is a part of the single-line comment (// ...).
  • (b) It is a completely valid comment. The // part is ignored by the compiler.
  • (c) This combination of comments is illegal, and will result in a compile time error.


(b)

Note

It is a completely valid comment.

Comments do not nest.

Everything from the start sequence of a multiple-line comment (/*) to the first occurrence of the end sequence of a multiple-line comment (*/) is ignored by the compiler.




PreviousNext

Related