Java nested generic type mismatch
If you want to be able to call fourth with a List<List<String>> argument, then you’ll need to change your signature to this: private static void fourth(List<? extends List<?>> a){ System.out.println(“List of a List of anything “); } The above will work because unlike List<List<?>>, List<? extends List<?>> is compatible with List<List<String>>. Think of it this … Read more