In Java, the command line arguments are passed into my program as a String array, like this:
public static void main(String[] args ) { }
Why does this use an array, and not a single String ?
I think it would be more flexible / adaptable if the command line arguments were passed in as a single String, and let my program do with it what I want. Is there any design advantage achieved by using a String array instead of a single String ?
C programmers were familiar with this format.
Green team decided to pass parameters this way.
Separating the command line to elements is platform dependant and (I think) done by the shell. So, passing command line as a array of Strings allows creating portable, cross-platform code.