Menu
Question Index
...

What will be the output of the following program?

public class DebugTest {
    private void verify(int age, String qua) {
        int x = age;
        String qualification = qua;
        if (x > 20 && qualification == "yes") {
            System.out.println("Eligible");
        } else {
            assert (x >= 20 && qualification == "yes") : "Age is more than 20";
            System.out.println("Not Eligible");
        }
    }
    public static void main(String arg[]) {
        new DebugTest().verify(19, "yes");
    }
}


Eligible
Not Eligible
Age is more than 20
AssertionError: Age is more than 20
Compilation Error or Runtime Error

Doubts

Problems

Topic: Advanced Java Programming Concepts

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App