The below line gives me error : What is the reason? EDIT I understand if I change my second ArrayList to List, it does not give me error. I want to know the reason of error though. Thanks Answer 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