Java: Constructing a class within an arraylist initialiser causes an error : <p>I've got a constructor that takes a parameter <code>ArrayList&lt;Setting&gt; settings</code>. </p>

<p>Now the problem is that I wrote the following call in a subclass:</p>

<pre><code>super(new ArrayList&lt;Setting&gt;(){new Setting("", this, 0)});
</code></pre>

<p>This causes a lot of errors, the main one being <code>Invalid method declaration; return type required</code>, as well as <code>'{' or ';' expected</code>, <code>Parameter expected</code>, <code>Unexpected token</code> and <code>Constructor Setting() is never used</code>.</p>

<p>I tried switching to using regular arrays and it worked fine:</p>

<pre><code>super(new Setting[]{new Setting("Exp Only", this, false)});
</code></pre>

<p>For now, I'm happy just using regular arrays, however I come across this error rather frequently, is there something I'm doing wrong or is this just the way it is, and if so, why?</p>
