How to add a new item to the list?(java)
<p>So i can get access to the list with a getter but how do i add a new user to the list ? What i need to add ?</p>

<pre><code>private List&lt;User&gt; userList= new ArrayList&lt;User&gt;(){{
    add(new User("ABC","123","B","b"));
    add(new User("CBA","123","I","b"));
}}; 

public List&lt;User&gt; getUserList() {
    return userList;
}
</code></pre>

<p>Yes i have added 2 users but they are added when i create the list, I wan'ted to have some kind of a method that i can call and it adds a new user to the list. Something like </p>

<pre><code>    public void addNewUser(User){
    //some kind of code
    }
</code></pre>
