You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

C.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. //interface IGuard<P> {}
  2. //
  3. ////interface Guard<P> extends IGuard<P> {}
  4. //
  5. //class GuardImpl<G> implements IGuard<G> {}
  6. //
  7. //public class C<T> {
  8. //
  9. // private boolean m1(Class<? extends IGuard<T>> guardClz) throws Exception { return false;}
  10. // private boolean m2(Class<? extends IGuard<T>>[] guardClz) throws Exception { return false;}
  11. //
  12. // public static void main(String []argv) throws Exception {
  13. // GuardImpl<String> g = new GuardImpl<String>();
  14. // C<String> newC = new C<String>();
  15. // newC.m1(g.getClass());
  16. //// newC.m2(new Class[]{g.getClass()});
  17. // }
  18. //
  19. //}
  20. interface IGuard<P> {}
  21. interface Guard<P> extends IGuard<P> {}
  22. class GuardImpl<X> implements Guard<X> {}
  23. public class C<T> {
  24. private boolean checkGuards(Class<? extends IGuard<T>>[] guardClz) throws Exception { return false;}
  25. public static void main(String []argv) throws Exception {
  26. GuardImpl<String> g = new GuardImpl<String>();
  27. //new C<String>().checkGuards(g.getClass());//Guard.class);
  28. new C<String>().checkGuards(new Class[]{g.getClass()});//Guard.class);
  29. }
  30. }