Menu
Question Index
...

What will be the output of the following program?

public class BooleanVariables
{
    public static void main(String args[])
    {
        boolean A = true;
        boolean B = false;
        System.out.print((A | B) + " ");
        System.out.print((A & B) + " ");
        System.out.print((!A) + " ");
        System.out.print((A ^ B) + " ");
        System.out.print(((A | B) & A) + " ");
    }
}


true false false true true
true false false false false
false false false true true
false false true true true
Compilation Error or Runtime Error

Doubts

Problems

Topic: Boolean Logical Operators In Java

Read this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App