james james - 1 year ago 87
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download