title: ArrayList to user defined class array
body: <p>I have a <code>List&lt;User&gt; userList</code> need to convert to <code>UserData[]</code> </p>
  
  <pre><code>for(int i = 0; i &lt; userList.size(); i++){
      userData[i] = userList.get(i);
  }
  </code></pre>
  
  <p>It always returns <code>null</code> though the list size is 1. can anyone help on this.</p>