Menu
Question Index
...

What will be the output of the following program? Assume that the argument passed as - "Is the program Execute or Not".

public class CommandLine {
    public static void main(String args[]) {
        for (int i = 0; i < args.length; i++)
            System.out.println("args[" + i + "]: " + args[i]);
    }
}


args[0]: Is
args[1]: the
args[2]: program
args[0]: Is the program Execute or Not
args[0]: Is
args[1]: the
args[2]: program
args[3]: Execute
args[4]: or
args[5]: Not
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: for Loop 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