Java OCA OCP Practice Question 514

Question

What is the value of (5 + (!2 + 8) * 3 - 3 % 2)/2 in Java?

  • A. 2
  • B. 11
  • C. 16
  • D. None of the above


D.

Note

The logical complement operator (!), which can only be applied to boolean values, is being applied to a numeric value.

The answer is that the expression wouldn't compile or run, making Option D the correct answer.




PreviousNext

Related