title: Cannot convert ArrayList<ArrayList<Integer>> to ArrayList<ArrayList<Object>>
body: <p>I have a function <code>foo</code> which accept a parameter <code>ArrayList&lt;ArrayList&lt;Object&gt;&gt;</code>. When I tried to call the function by passing a variable with type of <code>ArrayList&lt;ArrayList&lt;Integer&gt;&gt;</code>, the compiler shows error message that says : </p>
  
  <pre><code>incompatible types: 
  java.util.ArrayList&lt;java.util.ArrayList&lt;java.lang.Integer&gt;&gt; 
  cannot be converted into  
  java.util.ArrayList&lt;java.util.ArrayList&lt;java.lang.Object&gt;&gt;
  </code></pre>
  
  <p>What should I change/do in order to make the function accept parameter(s) with 2D <code>ArrayList</code> with any type? Thanks in advance.  </p>
  
  <p>Sample code </p>
  
  <pre><code>public static ArrayList&lt;ArrayList&lt;Object&gt;&gt; foo (ArrayList&lt;ArrayList&lt;Object&gt;&gt; parameter)
  {
      //do something
  }
  </code></pre>
  
  <p>Calling the function</p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;Integer&gt;&gt; parameter;
  //do something with the parameter
  ArrayList&lt;ArrayList&lt;Integer&gt;&gt; product = foo(parameter);//red line under parameter indicate it has error
  </code></pre>