Menu
Question Index
...

What will be the output of the following program?

class MyClass1
{

    public static void main(String s[])
    {
        boolean a, b, c;
        a = b = c = true;

        if( !a || ( b && c ) )
        {
            System.out.println("If executed");
        }
        else
        {
            System.out.println("else executed");
        }

    }
}


Compile time error
If executed
Run time error
else executed

Doubts

Problems

Topic: if Condition 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