Java OCA OCP Practice Question 862

Question

When a short is added to a float, what is the type of the result?

  • A. short
  • B. int
  • C. float
  • D. You can't add a short to a float.


C.

Note

When a short is added to a float, the narrower data type (short) is widened to match the wider type (float), and the result is a float.




PreviousNext

Related