HOME      BLOG       FORUMS      CONTACT       ABOUT

Get all the constructors of a class.

The getConstructors method of Class class can be used for getting all the constructors inside a class.

import java.lang.reflect.Constructor;

public class ClazzUtil {
	public static void main(String[] args){
		Constructor ct[] = Integer.class.getConstructors();
		for(int index=0; index < ct.length; index++){
			System.out.println(ct[index].getName());
		}
	}
}

Share

Tags: , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply