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.  
  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. public void add(String s) {
  16.  
  17. }
  18. }
  19.  
  20. public static class Animal {}
  21. public static class Tiger extends Animal {}
  22.  
  23. public static void main(final String[] args) throws Exception {
  24. List<Class<? extends Animal>> list = new ArrayList<>();
  25. list.add(Tiger.class);
  26. List<Class<?>> gList = list;
  27. }
  28. }
Compilation error #stdin compilation error #stdout 0.11s 320256KB
stdin
Standard input is empty
compilation info
Main.java:26: error: incompatible types: List<Class<? extends Animal>> cannot be converted to List<Class<?>>
				List<Class<?>>  gList = list; 
				                        ^
1 error
stdout
Standard output is empty