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 = 002;
        int l = 220;
        int m = 202;
        int sum = i + j + k + l + m;    
        System.out.println("Sum = " + sum);

    }
}


Sum = 640
Sum = 644
Sum = 222
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.