Java OCA OCP Practice Question 259

Question

When a negative long is cast to a byte, what are the possible values of the result?

  • A. Positive
  • B. Zero
  • C. Negative
  • D. All of the above


D.

Note

When a long is cast to a byte, only the most significant 8 bits are discarded.

The remaining bits might represent a positive number, zero, or a negative number.




PreviousNext

Related