How do I represent an empty list in java?
<p>I have this class has constructor taking a String and a Arraylist as argument;</p>

<pre><code>class Foo{
    String ide;
    ArrayList list;

    public TypeOperator(String ide, ArrayList list){
        this.ide = ide;
        this.list = list;
    }
}
</code></pre>

<p>so when I initialise the class like below:</p>

<pre><code>Foo one = new Foo("boo", []);
</code></pre>

<p>it gives errors. Well I can do this to make it work:</p>

<pre><code>ArrayList empty = new ArrayList();
Foo one = new Foo("boo", empty);
</code></pre>

<p>is there any reason why the first solution won't work? Or is there a way to make some changes to make it work? Thanks </p>