Java OCA OCP Practice Question 272

Question

Which of the following does not compile?

  • A. double num = 2.718;
  • B. double num = 2._718;
  • C. double num = 2.7_1_8;
  • D. None of the above; they all compile.


B.

Note

Underscores are allowed between any two digits in a numeric literal.

Underscores are not allowed adjacent to a decimal point, making Option B the correct answer.




PreviousNext

Related