Menu
Question Index
...

What will be the output of the following program?

class BoolLogic2
{
    public static void main(String s[])
    {
        boolean a = true;
        boolean b = true;
        boolean c = a & b;
        boolean d = a ^ b;
        boolean e = a || !b || c || !d;

        System.out.println("e = " + e);
    }
}


e = true
e = false
Compilation errors
Runtime error

Doubts

Problems

Topic: Short Circuit Logical Operators 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