Why does Java's main method use String[] instead of String dot dot dot
<p>An array parameter declaration causes a syntax error <strong>where the invocations happen</strong>.  Yet the main method uses String[] instead of String...  How can I understand this inconsistency? </p>

<pre><code>package domain.test;

import utilities.CConsole;

public class Tester {
    public static void main(String[] args) 
    {
        Test1 t = new Test1();
        t.method1(0); // the array will exist but have a length of zero
        t.method1(0, (Object[])null); // the array will not exist
        t.method1(0, "a");
        t.method1(0, "a", "b");
        CConsole.pw.format("\n");

        t.method2(0); // the array will exist but have a length of zero
        t.method2(0, (String[])null); // the array will not exist
        t.method2(0, "a");
        t.method2(0, "a", "b");
        CConsole.pw.format("\n");
    }
}

class Test1 {
    void method1(int number, Object... args) // Object[] causes syntax errors
    {
        if (args == null)
            CConsole.pw.format("args == null\n");
        else
        {
            CConsole.pw.format("args != null    ");
            CConsole.pw.format("args.length %d\n", args.length);
        }
    }

    void method2(int number, String... args) // String[] causes syntax errors
    {
        if (args == null)
            CConsole.pw.format("args == null\n");
        else
        {
            CConsole.pw.format("args != null    ");
            CConsole.pw.format("args.length %d\n", args.length);
        }
    }
}
</code></pre>

<p>How can the inconsistency be explained?</p>

<p>The following is included for the person that said that it compiles: To get this error change method1() to use Object[].</p>

<p><strong>Summary edit:</strong> The lesson seems to be this.  As @Andrew Barber has emphasized, String... is distinct from String[].  They <code>are not</code> interchangeable generally, so do not try to treat them the same way (even though I could name reasons why they seem interchangeable).  They <strong>are</strong> interchangeable in the case of main().  In the case of <code>main()</code> some people might call this sugar.</p>
