2 ms·
You've seen in Java how the main function has the `args` parameter as input, an approach which originally comes from C. In C code, main is actually not the firs
by kibwen 6y ago
You've seen in Java how the main function has the `args` parameter as input, an approach which originally comes from C. In C code, main is actually not the first code that gets run during the program; a compiler-provided shim function called "start" sets up the environment, which includes creating the `args` array, and then calls main and passes args in as a parameter to main. The start function needs something to call, and args needs to come from somewhere; having an explicit main function with an args parameter isn't the only way to achieve this, but it's not a bad way by any means.