fork download
  1. import java.util.*;
  2.  
  3. class Example {
  4. public static void main(String[] args) {
  5. Map<?, List<?>> m = new HashMap<>();
  6.  
  7. List<?> list = new ArrayList<>();
  8. list.add(m);
  9. }
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: error: no suitable method found for add(Map<CAP#1,List<?>>)
		list.add(m);
		    ^
    method Collection.add(CAP#2) is not applicable
      (argument mismatch; Map<CAP#1,List<?>> cannot be converted to CAP#2)
    method List.add(CAP#2) is not applicable
      (argument mismatch; Map<CAP#1,List<?>> cannot be converted to CAP#2)
  where CAP#1,CAP#2 are fresh type-variables:
    CAP#1 extends Object from capture of ?
    CAP#2 extends Object from capture of ?
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
stdout
Standard output is empty