fork(2) 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.  
  11. public static class Pair<A, B> {
  12. public static <A, B> Pair<A, B> create(A a, B b) {
  13. return null;
  14. }
  15. }
  16.  
  17. public static class Animal {}
  18. public static class Tiger extends Animal {}
  19.  
  20. public static void main(final String[] args) throws Exception {
  21. List<Class<? extends Animal>> list = new ArrayList<>();
  22. list.add(Tiger.class);
  23. List<Class<?>> gList = list;
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0.06s 380224KB
stdin
Standard input is empty
compilation info
Main.java:23: error: incompatible types
				List<Class<?>>  gList = list; 
				                        ^
  required: List<Class<?>>
  found:    List<Class<? extends Animal>>
1 error
stdout
Standard output is empty