I am trying to pass a 2d ArrayList to a constructor. The header of the constructor is as such:
public Table( ArrayList<ArrayList<?>> table )
{
After this I am trying to implement the following code in main:
ArrayList<ArrayList<Object>> 2dList = new ArrayList<ArrayList<Object>>(2);
Table Data1 = new Table( 2dList );
However, when I attempt such code I receive the following error:
no suitable contructor found for Table(java.util.ArrayList<java.util.ArrayList<java.lang.Object>>)
constructor Table.Table(java.util.ArrayList<java.util.ArrayList<?>>) is not applicable
(argument mismatch; java.util.ArrayList<java.util.ArrayList<java.lang.Object>> cannot be converted to java.util.ArrayList<java.util.ArrayList<?>>)
What would be the correct implementation? Forgive me if I have misunderstood any basic idea or have made a silly mistake.
Thank You.