1.

An expression involving byte, int, and literal numbers is promoted to which of these?(a) int(b) long(c) byte(d) floatThe question was posed to me in examination.This is a very interesting question from Integer and Floating Data Types topic in section Data Types, Variables and Arrays of Java

Answer»

Right choice is (a) int

For explanation I WOULD SAY: An expression involving BYTES, ints, shorts, literal numbers, the entire expression is PROMOTED to int before any calculation is done.



Discussion

No Comment Found

Related InterviewSolutions