What is the reason for using an array as a parameter in the main method?

Java concepts and its programming MCQs for PPSC, FPSC, NTS, and Pakistan government job tests. Select an option below, then read the explanation.

PPSCFPSCNTSPakistan govt jobs
Subject
Java concepts and its programmingsoftware-engineering-mcqs › java-concepts-and-its-programming
Published
18 Apr 2019
Last updated
28 May 2026

Browse all Java concepts and its programming MCQs

Choose the correct answer

Explanation

The main method uses an array parameter because it can hold multiple values, such as command-line arguments, enabling the program to process several inputs.

PakQuizHub — free MCQs and past papers for Pakistan government job tests. Content is for educational practice only.