Java OCA OCP Practice Question 146

Question

Which of the following does not compile?

  • A. int num = 999;
  • B. int num = 9_9_9;
  • C. int num = _9_99;
  • D. None of the above; they all compile.


C.

Note

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

Underscores are not allowed at the beginning or end of the literal.

Option C is the correct answer.




PreviousNext

Related