0% found this document useful (0 votes)
24 views1 page

Command Line Arguments

Uploaded by

rupendra10980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Command Line Arguments

Uploaded by

rupendra10980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Command line arguments

Java command-line argument is an argument, i.e., passed at the time of running the Java program. In Java,
the command line arguments passed from the console can be received in the Java program, and they can be
used as input. The users can pass the arguments during the execution, bypassing the command-line arguments
inside the main() method.
When we run a Java program, we can give extra information right after the program name. This extra
information is called command-line arguments. Let's understand this with the help of an example. If we run
this,
Java classname helo view
Here the words helo and view are command line arguments. The jvm collect these words and pass this words
to main method as the array of string called args. The jvm passes this to the program inside args[0] and args[1]
Why Use Command Line Arguments?
It is used because it allows us to provide input at runtime without modifying the whole program.
It helps to run programs automatically by giving them the needed information from outside.

You might also like