Is it possible to use getConstructor to get the constructor of class X below?
public class A { } public class Y { } public class X extends Y { public X(A a, Y[] yy) { } public void someMethod() throws SecurityException, NoSuchMethodException { Class<? extends Y> clazz = X.class; Constructor<? extends Y> c = clazz.getConstructor(new Class[]{ A.class, }); } }
thanks
java reflection
user63904
source share