What is the difference between String[] and String... in Java?

Viewed 119108

How should I declare main() method in Java?

Like this:

public static void main(String[] args)
{
    System.out.println("foo");
}

Or like this:

public static void main(String... args)
{
    System.out.println("bar");
}

What's actually the difference between String[] and String... if any?

5 Answers
Related