Menu
Question Index
...

What will be the output of the following program?

public class StringTest {
    public static void main(String arg[]) {
        String input = "123MeRiTCaMpUs456";
        int a = 6;
        int b = 3;
        int c = a & b;
        System.out.println(c);
        StringBuffer sb = new StringBuffer(input);
        if (input.equalsIgnoreCase("MeR") || input.equalsIgnoreCase(sb)) {
            System.out.print(input.toUpperCase());
        } else {
            System.out.print(input.toLowerCase());
        }
    }
}


2
123meritcampus456
3
123MeRitcampus456
2
123MeRITCAMPUS56
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java StringBuffer

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App