Menu
Question Index
...

What will be the output of the following program?

import static java.lang.System.*;
public class BeautifulFlowers {
    public static void main(String[] args) {
        System.out.println("Printed 1");
        out.print("Printed 2 ");
        out.append("Happy\n");
        int happyDays[] = {1, 2, 3, 4};
        for (int inBtech : happyDays)
            out.print(inBtech < happyDays[3] ? inBtech : ' ');
        out.append(' ');
        out.append('y');
        out.append('e');
        out.append('a');
        out.append('r');
        out.append('s');
        out.print("Completed");
    }
}


Printed 1
Printed 2 Happy
12332 yearsCompleted
Printed 1
Printed 2
Happy
123  years
Completed
Printed 1
Printed 2 Completed
Some other output
Output can not be determined
Compilation Error or Runtime Error

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App