Java Reflection Constructor Invoke invoke(Constructor constructor)

Here you can find the source of invoke(Constructor constructor)

Description

invoke

License

Apache License

Declaration

private static void invoke(Constructor<?> constructor) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.lang.reflect.Constructor;

public class Main {

    private static void invoke(Constructor<?> constructor) {
        constructor.setAccessible(true);
        try {/* w  w  w.  jav  a  2s.  c  om*/
            constructor.newInstance();
        } catch (Exception e) {
            throw new IllegalStateException("invoking constructor failed.",
                    e);
        }
    }
}

Related

  1. invoke(Constructor constructor, Object... args)
  2. invoke(Constructor constructor, Object... args)
  3. invokeConstructor(Class clazz, Class[] paramTypes, Object[] params)
  4. invokeConstructor(Class clazz, Object... parameters)