Java OCA OCP Practice Question 137

Question

Which of these class names best follows standard Java naming conventions?

  • A. fooBar
  • B. FooBar
  • C. FOO_BAR
  • D. F_o_o_B_a_r


B.

Note

In Java, class names begin with an uppercase letter by convention.

Class name uses lowercase with the exception of new words.

Option B follows this convention and is correct.

Option A follows the convention for variable names.

Option C follows the convention for constants.

Option D doesn't follow any Java conventions.




PreviousNext

Related