Multiple choice

Which of the following is true?

i. Only byte value used in the expression will be promoted to int when the expression is evaluated. ii. Only short value used in the expression will be promoted to int when the expression is evaluated. iii. Both byte and short value used in the expression will be promoted to int when the expression is evaluated. iv.Neither byte nor short value used in the expression will be promoted to int when the expression is evaluated.

  1. i. is correct

  2. ii. is correct

  3. iii. is correct

  4. iv. is correct

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This answer is correct. Byte and short value both will be promoted to int when the expression is evaluated. So, the answer is correct.