Menu
Question Index
...

What will be the value of s at the end of the program?

class IntegerConversion
{

    public static void main(String args[])
    {
        int i = 50000;
        short s = i;
    }
}


s will be 50000
s will be between -32787 and 32786
s will be between -128 to 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