Menu
Question Index
...

What will be the output of the following program?

public class NameDisplay {
    public static void display(String... ar) {
        for (String element : ar) {
            System.out.print(element + " ");
        }
    }
    public static void main(String[] args) {
        display("Kiran", "Kumar", "Siva", "Kumar");
    }
}


Kiran Kumar Siva
Kiran Kumar Siva Kumar
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java String Arrays - String Arrays 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