How to pass command line arguments in Java?

Ads

 
 

Share on Google+Share on Google+

Java Coder
How to pass command line arguments in Java?
1 Answer(s)      6 months and 3 days ago
Posted in : Java Beginners

Hi,

In a Java program I have to write for reading the command line arguments and use it in a programming.

How to pass command line arguments in Java?

Share me the sample code.

Thanks

Ads
View Answers

April 16, 2017 at 6:12 PM


Hi,

You can use the String[] args of the main function in Java.

Then use can use the the index number for example 0 for getting the data of the 0 position.

e.g:

args[0]

Passing Command Line Arguments.

Thanks


Ads









Ads

 
Advertisement null

Ads