Command line arguements

what is the difference between these command line arguements.

  1. public static void main(String args)
  2. public static void main(String args)

pls tell me the difference about it.

With array arguments you can either put the brackets on the type or on the variable name. Both are valid but putting it on the type is clearer (imo) because all of the type information is available by looking at the type (rather than also having to check the variable name).

So these two are equivalent:

// This:
String[] args
// And this:
String args[]
1 Like

oh okay okay. thank u man! :blush:

1 Like