/*****************************************************************/ /* Copyright 2013 Code Strategies */ /* This code may be freely used and distributed in any project. */ /* However, please do not remove this credit if you publish this */ /* code in paper or electronic form, such as on a web site. */ /*****************************************************************/ package test; import java.lang.reflect.Constructor; public class ClassConstructorTest { public static void main(String args[]) throws Exception { Class ctClass = ConstructorTest.class; Constructor[] constructors = ctClass.getConstructors(); for (int i = 0; i < constructors.length; i++) { System.out.println("constuctor: " + constructors[i]); } Constructor[] declaredConstructors = ctClass.getDeclaredConstructors(); for (int i = 0; i < declaredConstructors.length; i++) { System.out.println("declared constructor: " + declaredConstructors[i]); } } }