Menu
Question Index
...

What will be the output of the following program?

public class Shock {
    public static void main(String[] args) {
        Long abc = 200L;
        Long bca = 199L;
        Long cab = 100L;
        if ((abc > bca) ^ ((cab * 3) == abc))
            System.out.print("ABC");
        else if ((bca + 1 != abc) ^ ((cab * 3) == bca))
            System.out.print("BCA");
        System.out.print("CAB");
    }
}


ABCBCACAB
ABCCAB
CAB
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Creating Objects for Primitive Data Types (Byte, Short)

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App