Menu
Question Index
...

What will be the output of the following program?

public class ProjectWork {
    public static void main(String[] args) {
        Project();
        Work();
    }
    protected static void Project() {
        assert false;
        assert false;
    }
    private static void Work() {
        assert true;
        int i = 0;
        while(assert){
            assert false;
            i++;
        }
        System.out.print("i = " + i);
        assert false;
    }
}


i = 0
i = 1
i = 2
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Other Advanced Topics 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