0

I'm watching Java tutorials right now and I've noticed that some people use:

public static void main(String[] args)

and some people use:

public static void main(String args[])

I was just wondering if there is any difference between them.

Tiny
  • 27,221
  • 105
  • 339
  • 599
  • 1
    also, http://stackoverflow.com/questions/8290492/variations-on-public-static-main-string-args –  Apr 01 '14 at 16:56
  • 2
    When declaring an array either `type[] variable` or `type variable[]` is allowed, though the first form is generally preferred. – Hot Licks Apr 01 '14 at 16:56
  • Oh, i see. Thank you i didn't see that post :) – iLoveCakeAndPie Apr 01 '14 at 16:57
  • (The second form it allowed to make old C programmers happy, since C only allows the second form. But the second form is confusing, since the variable being declared has a type of "array of type".) – Hot Licks Apr 01 '14 at 17:02

1 Answers1

0

No difference, it is array of string.

String[] args or String args[] are equivalents.

Roman C
  • 49,761
  • 33
  • 66
  • 176