Menu
Question Index
...

What will be the output of the following program?

public class CanYouDoIt {
    static boolean bool;
    static int[] iary = new int[1];
    static char chr;
    static boolean[] barr = new boolean[1];
    public static void main(String args[]) {
        boolean b = false;
        if (bool) {
            b = (chr == iary[chr]);
        } else {
            b = (barr[chr] = bool);
            System.out.println(b + " " + barr[chr]);
        }
    }
}


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

Doubts

Problems

Topic: Static Keyword 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