+5

Why we are passing String[] in main function in java..?

Help me out of this!!

4/10/2019 6:39:11 AM

Chaitu

3 Answers

New Answer

+4

The command line arguments are an array of strings with the first element being the name of the program.

+3

It is called the command line arguments .. They are the parts which are required for your program execution. For example if you want to print "hello world", it is passed as one of the arguments. And it seems that commands in the command line accept only string arguments .. And it's an array because other Collections didn't exist in java 1

+2

Yeah got it.. thanks