james james - 3 months ago 8
Java Question

What is the correct Java main() method parameters syntax?

Is there a functional difference between these methods?

public static void main(String[] args) { }

public static void main(String args[]) { }


EDIT (added this syntax from other contributors) :

public static void main(String... args) { }

Answer

No, but the first is the prefered style.

Edit: Another option is

public static void main(String... args)

which additionally allows callers to use varargs syntax.

Comments