ReflectionUtils.java Source code

Java tutorial

Introduction

Here is the source code for ReflectionUtils.java

Source

import java.lang.reflect.Constructor;

public class ReflectionUtils {

    public static boolean hasDeclaredConstructor(Class targetClass, Class[] partypes) {
        Constructor constructor = null;
        try {
            constructor = targetClass.getConstructor(partypes);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return constructor != null;
    }

}