Menu
Question Index
...

What will be the output of the following program?

public class Loopy {
    public static void main(String[] args) {
        final int start = Integer.MAX_VALUE - 100;
        final int end = Integer.MAX_VALUE;
        int count = 0;
        for (int i = start; i <= end; i++)
            count++;
        System.out.println("Output=" + count);
    }
}


Output=99
Output=100
Output=101
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: final Keyword 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