Important Java Mcq 1

An expression involving byte, int, and literal numbers is promoted to which of these?

a) int

b) long

c) byte

d) float

Answer

a) int

Explanation:

In an expression involving bytes, ints, shorts, or literal numbers, the entire expression is promoted to int before any calculation is done so correct response will be option a (int).

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?