Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0417 Get the contructors from a class

Constructor<T> getConstructor(Class<?>... parameterTypes) Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object. Constructor<?>[] getConstructors() Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class object. Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes) Returns a Constructor object that reflects the specified constructor of the class or interface represented by this Class object. Constructor<?>[] getDeclaredConstructors() Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object.