fork(1) 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. public class Main
  9. {
  10. public static Class<?> getFilterClass(){
  11. return String.class;
  12.  
  13. }
  14. public static <T> Collection<T> getAllForClass(Class<T> clazz) throws InstantiationException, IllegalAccessException{
  15. Collection <T> x = new ArrayList<T>();
  16. x.add(clazz.newInstance());
  17. return x;
  18. }
  19.  
  20. public static void main(String[] argv) throws InstantiationException, IllegalAccessException{
  21.  
  22. Collection <?extends Object> y = getAllForClass(getFilterClass());
  23.  
  24. System.out.println(y);
  25. }
  26.  
  27. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
[]