Menu
Question Index
...

What will be the output of the following program?

class BoolTest
{
    public static void main(String args[])
    {
        boolean b1 = false;
        System.out.print("b1 = " + b1);
        b1 = true;
        System.out.println("b1 = " + b1);
    }
}


b1 = falseb1 = true
b1 = false
b1 = true
Compilation errors.
b1 = true
b1 = true

Doubts

Problems

Topic: Boolean Literals 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