What will be the output of the following program?

public class AssertionTest {
    public static void main(String[] args) {
        int value = 10;
        assert value > 5 : "Value is too low";
        System.out.println("Assertion passed");
    }
}

1
Assertion passed
2
Compilation fails
3
An AssertionError is thrown with the message “Value is too low”
4
An AssertionError is thrown but "Assertion passed" is printed
5
Question Not Attempted

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation