-1

When using command line arguments in java I am curious to how big is the args array parameter in main. And if it is varied length how does main know the length?

1 Answers1

0

It will be as big as needed to hold the arguments passed in. So if you do

java -jar myjar.jar 1 2 34

Args will contain

["1", "2", "34"]

Note the array is typed as string so if you pass in numbers you need to convert the string containing the number to actual number.