fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. List<List> a = new ArrayList();
  13. List<List<?>> b = new ArrayList();
  14.  
  15. a = b; // incompatible types
  16. b = a; // incompatible types
  17. }
  18. }
Compilation error #stdin compilation error #stdout 0.1s 320256KB
stdin
Standard input is empty
compilation info
Main.java:15: error: incompatible types: List<List<?>> cannot be converted to List<List>
a = b; // incompatible types
    ^
Main.java:16: error: incompatible types: List<List> cannot be converted to List<List<?>>
b = a; // incompatible types
    ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
stdout
Standard output is empty