Menu
Question Index
...

What will be the output of the following program?

class SumOfIntegers
{

    public static void main(String s[])
    {

        int i = 200;
        int j = 020;
        int k = 0x02;
        int l = 220;
        int m = 0x202;

        int sum = i + j + k + l + m;
    
        System.out.println("Sum = " + sum);

    }
}


Sum = 952
Sum = 644
Sum = 640
Program does not compile.

Doubts

Problems

Topic: Integer Literals In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2016 - 2017

All Rights Reserved.