fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. System.out.println("hi");
  10. }
  11.  
  12. private <T> Class<? extends T> getClass(T object) {
  13. return object.getClass();
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:13: error: incompatible types: Class<CAP#1> cannot be converted to Class<? extends T>
       return object.getClass();
                             ^
  where T is a type-variable:
    T extends Object declared in method <T>getClass(T)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ? extends Object
1 error
stdout
Standard output is empty