Menu
Question Index
...

What will be the output of the following program?

class IntegerGroupAddition
{

    public static void main(String args[])
    {
        long l = 30;
        int i = 50;
        short s = 60;
        byte b = 70;

        int sum = l + i + s + b;
    
        System.out.println("Sum = " + sum);
    }
}


Sum = 210
Sum = 128
Sum = 127
Program does not compile.

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