Incompatible types List of List and ArrayList of ArrayList

If you had a List<List<Integer>> then you’d be able to add a LinkedList<Integer> to it. But you can’t do this for an ArrayList<ArrayList<Integer>>, so the latter can’t possibly be a type of List<List<Integer>>.

Leave a Comment