Menu
Question Index
...

What will be the output of the following program?

public class ArrayTest {
    public static void main(String[] args) {
        String names[] = {
            "Merit"//First
            ,
            "Campus"//Second
            ,
            "Java"//Third
            ,
            "Programming"//Fourth
            ,
            "Competition"//Fifth
        };
        for (String name : names) {
            System.out.println(name);
        }
    }
}


Merit
Campus
Java
Programming
Competition
MeritCampusJavaProgrammingCompetition
Merit
Some other output
Compilation Error or 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