| Author |
Using multiple command line arguments to open multiple files
|
Jack Sloan
Greenhorn
Joined: Mar 23, 2011
Posts: 11
|
|
Hey guys, I am trying to get the hang of CommandLine arguments and am trying to use two at a time say fro instance where I put two files in and I want my program to open both and collect statistics about it.
This is what I have.
How can I make it so two or more filenames can be added to this and then print out the results?
Thanks
|
 |
Edwin Torres
Ranch Hand
Joined: Mar 19, 2011
Posts: 37
|
|
Notice that the args parameter of main() is an array:
When you pass arguments in on the command line, they are placed into that args array. So if your command line is this:
java ProcessText one two three
Then your args array will look like this:
{ "one" , "two" , "three" }
|
Follow me: @CompGuyProbs
Read me: Freehold Computers Examiner
|
 |
Jack Sloan
Greenhorn
Joined: Mar 23, 2011
Posts: 11
|
|
|
Thank you I got it.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Using multiple command line arguments to open multiple files
|
|
|