Menu
Question Index
...

What will be the output of the following program?

public class IAmGreat {
    public static void main(String args[]) {
        int i = 132;
        short s = 15;
        byte b = (byte) i;
        int x = b + s;
        System.out.println("Value of x is " + x);
    }
}


Value of x is 147
Value of x is -109
Compilation Error
Runtime Error

Doubts

Problems

Topic: Type Casting In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App