title: Can't add int to ArrayList of integers
body: <p>I'm supposed to create a new array, which contains the first element of arrays a and b (excpet if one is empty, I must skip it). The problem is that when I try to add the int element to the ArrayList I get the error:
  "incompatible types: java.util.ArrayList cannot be converted to int[]"
  This is so annoying..
  Here's the code:</p>
  
  <pre><code>public int[] front11(int[] a, int[] b) {
  ArrayList&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
  if (a.length&gt;0 &amp; b.length&gt;0){
      list.add(a[0]);
      list.add(b[0]);
  }
  if (b.length==0 &amp; a.length&gt;0){
      list.add(a[0]);
  }
  if (b.length&gt;0 &amp; a.length==0){
      list.add(b[0]);
  }
  return list;
  </code></pre>
  
  <p>}</p>