Menu
Question Index
...

What will be the output of following program?

public class JavaMeritCampusCom {
    static void display(String hai) {
        System.out.println(hai);
    }
    static void display(String... atr) {
        for (String element : atr) {
            System.out.print(element);
        }
    }
    public static void main(String[] args) {
        String str[] = {"U", "R"};
        display();
        display("Registered");
        display("Hai ", "hello ", str[0], " ", str[1], " ", "Registered.");
    }
}


Output: Registered
Output: Registered
Output: Hai hello U R Registered.
Output:
Output: Registered
Output: Hai hello U R Registered.
Output: Output: Registered
Output: Hai hello U R Registered.
Some other Output
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