Java OCA OCP Practice Question 29

Question

Which of the following is not a valid code comment in Java?

  • A. // Add 5 to the result
  • B. /* TODO: Fix bug 12312 */
  • C. # Add configuration value
  • D. /* Read file from system /


C.

Note

Java accepts Options A, B, and D as valid comments.

The /* */ syntax can have additional and star * characters as shown in B and D.

Option C is incorrect as hash tag (#) is not a valid comment character in Java.




PreviousNext

Related